printf()的返回值

来源:互联网 发布:弹性矩阵和刚度矩阵 编辑:程序博客网 时间:2024/05/21 14:03
#include <stdio.h>#include <stdlib.h>int main(){                 int i=43;                printf( "%d\n",printf("%d" ,printf("%d",i)));                system( "pause");                 return 0;}

printf() 返回一个int值,表示被打印的字符数

i=43,先输出43

43为两个字符,输出2

2为一个字符,输出1

#include <stdio.h>#include <stdlib.h>int main(){int n=printf("Hello world!\n");printf("%d",n);system("pause");return 0;}

输出结果:Hello world!

          13

本文出自 “追寻内心的声音” 博客,转载请与作者联系!

0 0
原创粉丝点击