浙江省高等学校教师教育理论培训

微信搜索“教师资格证岗前培训”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

fputs_百度百科

    fputs

      函数名: fputs

      功 能:向指定的文件写入一个字符串(不写入字符串结束标记符‘\0’)。成功写入一个字符串后,文件的位置指针会自动后移,函数返回值为0;否则返回EOR(符号常量,其值为-1)。

      用 法: int fputs(char *string, FILE *stream);

      参数: string是要写入文件的字符串。

      stream 很明显是一个FILE对象。

      程序例:

      #include <stdio.h>

      int main(void)

      {

      FILE *fpout=fopen("1.txt","wr");//

      /* write a string to standard output */

      fputs("Hello world\n", fpout);

      return 0;

      }

posted on 2012-05-21 17:50  lexus  阅读(413)  评论(0编辑  收藏  举报