#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); }
2024-02-14 23:36:52
#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); }