VC++6.0 我这样写哪里错了呢?
#include <stdio.h>int main(){ FILE * fp; char c; c = getchar(); if((fp = fopen(ccc.c,"w")) == NULL) { printf("cannot open file\n"); exit(0); } fputc(c,fp); fclose(fp); return 0;}/* fopen example */#include <stdio.h>int main (){ FILE * pFile; pFile = fopen ("myfile.txt","w"); if (pFile!=NULL) { fputs ("fopen example",pFile); fclose (pFile); } return 0;}
[解决办法]
exit(0); //要加头文件#include <stdlib.h>