文件中的路径问题
#include"stdio.h"
#include"stdlib.h"
main()
{
FILE *fp;char ch;
if((fp=fopen("a1.txt","w"))==NULL)
{
printf("can't open file\n");
exit(1);
}
do{
ch=getchar();
fputc(ch,fp);
}
while(ch!='\n');
fclose(fp);
}
为什么在语句if((fp=fopen("a1.txt","w"))==NULL)中,吧a1.txt改成c:\a1.txt就打不开了啊
怎么试也不行