创建一个文件使用fopen打开,然后使用fprintf输出,最后关闭文件流
FILE *out; out = fopen("test.txt","a+"); if(out == NULL){ exit(EXIT_FAILURE); } printf("hello~\n"); int i; for(i=0;i<10;i++){ fprintf(out,"heelo %d\n",i); } fclose(out);
2021-12-14 06:40:46
创建一个文件使用fopen打开,然后使用fprintf输出,最后关闭文件流
FILE *out; out = fopen("test.txt","a+"); if(out == NULL){ exit(EXIT_FAILURE); } printf("hello~\n"); int i; for(i=0;i<10;i++){ fprintf(out,"heelo %d\n",i); } fclose(out);