C语言 简单的文件操作 写文件
作者:互联网
#include <stdio.h> #define BUFSIZE 50 int main() { FILE* f; char buf[BUFSIZE] = "this is fputs function!\n hello fputs!"; f=fopen("D:\\1.txt","w"); if(NULL == f) { printf("write file failed!"); } fputs(buf,f); fclose(f); }
标签:文件,int,C语言,fputs,FILE,简单,BUFSIZE,buf 来源: https://www.cnblogs.com/liguohao/p/15800805.html