Chinaunix

标题: printf函数 [打印本页]

作者: aaron_xueli    时间: 2010-10-06 13:01
标题: printf函数
printf函数返回值为0意味着什么呢?
作者: fender0107401    时间: 2010-10-06 13:03
man printf?
作者: tempname2    时间: 2010-10-06 13:06
本帖最后由 tempname2 于 2010-10-06 13:09 编辑

printf 返回成功打印项目的个数,以返回值无人问津著称。
作者: cobras    时间: 2010-10-06 13:49
snprintf返回值常需要使用.
作者: brightsun__    时间: 2010-10-06 14:55
3楼正解
作者: bzhao    时间: 2010-10-06 21:10
The manpage is saying:

Upon successful return, these functions return the number of characters printed  (not  including  the  trailing
       '\0' used to end output to strings).
作者: pmerofc    时间: 2010-10-06 21:34
提示: 作者被禁止或删除 内容自动屏蔽
作者: cobras    时间: 2010-10-06 23:07
printf返回0,如果按照标准来说,就是没有输出任何字符.但是这样的printf有意义吗?




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2