概述
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函数的运用(组图)所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复