C/C++怎么向文件一行一行的写内容?

\r\n换行

fp=fopen("aa.txt","w+");

fwrite("a\r\n",1,3,fp);

fwrite("a\r\n",1,3,fp);

fclose(fp);