我想阅读一个 .txt 文件。即使我给出了正确的路径,我也会收到以下错误:
Error1: File is undeclared first time use in function Error2: file is undeclated first time use in function
并将\U
其作为转义序列。请指导我。
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
File *file = fopen("C:\Users\Admin\Desktop\files.txt", "r");
char c;
do
{
c = fgetc(file);
printf("%c",c);
}
while (c != EOF)
fclose(file);
system("PAUSE");
return 0;
}