在比较表达式中,为了防止手误,把"=="写成"=",应该把常量置左变量置右,利用编译器语法检查功能发现书写错误
pirntf();的返回值是一个int值,表示被打印的字符数
如 int retno=printf("%d",90); //retno=2
int retno=printf("123n"); //retno=4 包含换行字符
printf("%d",printf("%d",printf("%d",43)));的输出是4321
输出由里到外如果是失败,返回值为负数,并设置错误指示符
Return Value
On success, the total number of characters written is returned.If a writing error occurs, the error indicator (ferror) is set and a negative number is returned.If a multibyte character encoding error occurs while writing wide characters, errno is set to EILSEQ
and a negative number is returned.
添加新评论0 条评论