#include <stdio.h>
#include<stdlib.h>
void main()
{
FILE *fp;
char ch;
char filename[200];
printf("enter filename:");
scanf("%s",filename);
if((fp=fopen("filename","r+"))==NULL)
{
printf("cannot open the file!");
exit(0);
}
ch=fgetc(fp);
while(ch!=EOF)
{
putchar(ch);
ch=fgetc(fp);
}
fclose(fp);
}
这么一段代码 我输入地址的d:\\a.txt 后显示cannot open the file!,我想问一下,问题出在哪,为什么打不开啊