发布网友
共1个回答
热心网友
#include<stdio.h>
void main()
{
FILE *fp;
if((fp=fopen("data.txt","wt"))==NULL)
{
printf("Can't open the file!\nPress any key to exit!");
getch();
exit(0);
}
fprintf(fp,"日记内容");
fclose(fp);
}