先上菜
#include<stdlib.h>
#include<stdio.h>int main()
{
FILE* pfWrite = fopen("test.txt", "w");
if (pfWrite == NULL)
{
printf("%s\n", strerror(errno));
return 0;
}//写文件
fputc('b', pfWrite);
fputc('i', pfWrite);
fputc('t', pfWrite);//关闭文件
fclose(pfWrite);
pfWrite = NULL;return 0;
}
运行之后会创建一个文件,并且在文件中输入字符,看图像