这段代码有什么错误?我只是 C 语言的新手。
#define FNAME "c:\\users\\mahmud\\desktop\\CDs\\"
#define READ_BIN "rb"
static void open_existing_list()
{
char name[11];
FILE *fptr;
printf("\nPlease enter list name: ");
fflush(stdin);
scanf("%s", name);
fptr = fopen(FNAME name ".dat", READ_BIN);
}
此代码用于从用户那里读取文件名,然后打开此文件。
D:\Mhmud\Mahmud\Programming\C\Videos\VTC - C Programming\Course_Project\main.c In function `open_existing_list':
75 D:\Mhmud\Mahmud\Programming\C\Videos\VTC - C Programming\Course_Project\main.c syntax error before "name"
D:\Mhmud\Mahmud\Programming\C\Videos\VTC - C Programming\Course_Project\Makefile.win [Build Error] [main.o] Error 1