c语言中,成功调用fprintf fscanf函数后有什么返回值吗

 我来答
吾好梦中殺猪
推荐于2017-09-21 · TA获得超过335个赞
知道小有建树答主
回答量:267
采纳率:0%
帮助的人:324万
展开全部
当然有。楼主可看MSDN有详细描述,

fscanf, fwscanf
Read formatted data from a stream.
int fscanf( FILE *stream, const char *format [, argument ]... );
int fwscanf( FILE *stream, const wchar_t *format [, argument ]... );

Return Value // 也就是正常会返回从文件成功写入的变量个数,否则返回EOF
Each of these functions returns the number of fields successfully converted and assigned; the return value does not include fields that were read but not assigned. A return value of 0 indicates that no fields were assigned. If an error occurs, or if the end of the file stream is reached before the first conversion, the return value isEOFfor fscanf orWEOFforfwscanf.

fprintf, fwprintf
Print formatted data to a stream.
intfprintf(FILE*stream,constchar*format[,argument]...);
intfwprintf(FILE*stream,constwchar_t*format[,argument]...);

Return Value // 也就是正常会返回写入文件的字节数,否则返回负数
fprintfreturns the number of bytes written.fwprintfreturns the number of wide characters written. Each of these functions returns a negative value instead when an output error occurs.
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式