C语言写入文件

// C语言写入文件#include stdio.hint main() {FILE *fp;fp = fopen(/tmp/test.txt, w+);

编程学习网为您整理以下代码实例,主要实现:C语言写入文件,希望可以帮到各位朋友。

// C语言写入文件
#include <stdio.h>

int main() {

   file *fp;

   fp = fopen("/tmp/test.txt", "w+");
   fprintf(fp, "This is testing for fprintf...\n");
   fputs("This is testing for fputs...\n", fp);
   fclose(fp);
}

本文标题为:C语言写入文件