printf 里面嵌套 printf 会是什么结果

  今天在知乎里看到这个话题。瞬间秒杀呀,还没有考虑过这个问题。
#include <stdio.h>

int main(int argc, char *argv[])

{

int a=123456;

printf("%d",a);//123456printf("\n");

printf("%d",printf("%d",a));//1234566 printf("\n");

printf("%d",printf("%d",printf("%d",a));//12345661 printf("\n");

return 0;}
 
function

printf

int printf ( const char * format, ... ); Print formatted data to stdout Writes to the standard output (stdout) a sequence of data formatted as the format argument specifies. After theformat parameter, the function expects at least as many additional arguments as specified in format.
Return Value
On success, the total number of characters written is returned. On failure, a negative number is returned. 也即:printf返回的是打印字符的总个数。。
posted @ 2012-04-08 17:04  郭—大—侠  阅读(519)  评论(0编辑  收藏  举报