qfedu-c-level/day14/d5.c

18 lines
277 B
C
Raw Normal View History

2023-07-21 00:58:46 +08:00
// 读写文本文件
#include <stdio.h>
#include <stdlib.h>
int main()
{
char *f = (char *)malloc(100);
FILE *fp = fopen("d5.txt", "w");
if (fp == NULL)
{
perror("fopen");
exit(1);
}
fputs("disen", fp);
fclose(fp);
return 0;
}