文件读写
#include "Stdio.h"
main()
{FILE *p;
char ch;
if(p=(fopen("chen","ab"))==NULL)
{printf("cannot open file\n");
exit(0);}
while((ch=getchar())!='#')
{fputc(ch,p);
putchar(ch);}
fclose(p);
getch();
}
为什么文件是空的
运行后出现一条语句
null pointer assignment
什么意思?该怎么解决?
谢鸟....