thx za radu.
Když už to fungovalo (trochu jiná verze, ale fungovala cca stejně), tak jsem jí chtěl upgradovat:
#include <stdio.h>
int main()
{
char fn[13];
char string[100];
char cd[2];
char dir[100];
char exit;
while(cd!='N' || cd!='n')
{
printf("Current directory: ");
system("cd");
getch();
printf("/nDo you want to change directory? [Y/N] ");
scanf("%1s", &cd);
switch (cd[0])
{
case 'Y':
case 'y':
printf("Insert address. Absolute or relative: ");
scanf("%s", &dir");
sprintf(string, "cd %s", dir);
break;
case 'N':
case 'n':
break;
default:
return 1; //User's stupid
break;
}
}
while (exit!='y' || exit!='Y')
{
string = 'exit';
printf("Filemane:");
scanf("%13s", &fn);
// string = 'tcc\\tcc.exe Development\\'fn'.c -o Development\\'fn'.exe';
sprintf(string, "tcc\\tcc.exe Development\\%s.c -o Development\\%s.exe", fn, fn);
system(string);
getch();
printf("Do you want to exit? [Y/N] ");
scanf("%1s", &exit);
}
return 0;
}
a nastal problém: na řádku 23 (
sprintf(string, "cd %s", dir);
) mi kompilátor háže:
',' expected
nechápu problém, protože mi nourmálně fungovalo
sprintf(string, "tcc\\tcc.exe Development\\%s.c -o Development\\%s.exe", fn, fn);
na ř. 40
Kde to vězí?