fprintf函数的运用(组图)
08-19栏目:技术
TAG:fprintf
fprintf
fprintf()用于文件操作
#include
int fprintf( FILE *stream, const char *format, ... ); copyright www.jhua.org
fprintf()函数根据指定的format(格式)发送信息(参数)到由stream(流)指定的文件.因此fprintf()可以使得信息输出到指定的文件.比如 jhua.org
char name[20] = "Mary";
FILE *out;
out = fopen( "output.txt", "w" );
if( out != NULL )
fprintf( out, "Hello %sn", name );
copyright www.jhua.org
fprintf()和printf()一样工作.
https://www.jhua.org
printf是打印输出到屏幕,fprintf是打印输出到文件。 https://www.jhua.org
fprintf()的返回值是输出的字符数,发生错误时返回一个负值.
copyright www.jhua.org
在有些地方,有这样的定义:printf(…)=fprintf(stdout,…). copyright jhua.org
举例用法: copyright jhua.org
#include
#include
FILE *stream;
void main( vo
最后
以上就是潇洒荔枝最近收集整理的关于fprintf函数matlab,fprintf函数的运用(组图)的全部内容,更多相关fprintf函数matlab,fprintf函数内容请搜索靠谱客的其他文章。
发表评论 取消回复