fprintf

来自cppreference.com
< cpp | io | c
跳转到: 导航, 搜索

语法:

    #include <cstdio>
    int fprintf( FILE *stream, const char *format, ... );

fprintf()函数将特定格式的信息(参数)发送到由stream标示的文件中。fprintf()中的format参数和 printf()中的一样。fprintf()的返回值是输出字符的个数,或者错误发生时返回负值。一个例子:

     char name[] = "Mary";
     FILE *out = fopen( "output.txt", "w" );
     if( out != NULL )
       fprintf( out, "Hello %s\n", name );

相关主题: fputc, fputs, fscanf, printf, sprintf

个人工具
名字空间
操作
导航
工具箱
其他语言