你在D盘建立文件,怎么在E盘打开呢?
int main()
{ FILE *pf;
char Text[100];
if((pf = fopen("D:\\A.txt","r")) == 0)
{
printf("The file can not find!\n");
exit(0);
}
fgets(Text,sizeof(Text),pf);
printf("%s\n",Text);
return 0;
}
int main()
{ FILE *pf;
char Text[100];
if((pf = fopen("D:\\A.txt","r")) == 0)
{
printf("The file can not find!\n");
exit(0);
}
fgets(Text,sizeof(Text),pf);
printf("%s\n",Text);
return 0;
}