C 求解惑

Anod 2012-06-07 02:33:00
1.#include <stdio.h>
2.

3.int main()
4.{
5.
int i=43;
6.
printf("%d\n",printf("%d",printf("%d",i)));
7.
return 0;
8.}

...全文
210 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
AnYidan 2012-06-08
  • 打赏
  • 举报
回复
printf converts and writes output to stream under the control of format. The return value is the number of characters written, or negative if an error occurred.
  • 打赏
  • 举报
回复
你去看一下printf这个函数的返回值就清楚了
猪头小哥 2012-06-07
  • 打赏
  • 举报
回复
函数的压栈~~
zarbidar 2012-06-07
  • 打赏
  • 举报
回复
必须统一 有时候c还强制转换呢 不过都看你用什么编译器了
lbq199204 2012-06-07
  • 打赏
  • 举报
回复
再++
[Quote=引用 5 楼 的回复:]
引用 4 楼 的回复:

printf函数返回值为整型。若成功则返回输出的字符数,输出出错则返回负值。

++
[/Quote]
proorck6 2012-06-07
  • 打赏
  • 举报
回复
printf函数有返回值,楼主的程序打印了这个返回值。
W170532934 2012-06-07
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 的回复:]

printf函数返回值为整型。若成功则返回输出的字符数,输出出错则返回负值。
[/Quote]
++
艳琦罗生 2012-06-07
  • 打赏
  • 举报
回复
printf函数返回值为整型。若成功则返回输出的字符数,输出出错则返回负值。
lingjin520 2012-06-07
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]

printf是有返回值的。返回值是打印的字符数。
C/C++ code

int i = printf("here\n");
i = printf("%d %d", i, i);
printf("\n%d", i);


http://blog.csdn.net/zuoyanjie/article/details/5719957
[/Quote]
明白了,楼主改下你的代码后就很清楚的看明白了
int i=43;  
printf("[%d]\n",printf("{%d}",printf("(%d)",i)));
luotuo44 2012-06-07
  • 打赏
  • 举报
回复
printf是有返回值的。返回值是打印的字符数。

int i = printf("here\n");
i = printf("%d %d", i, i);
printf("\n%d", i);

http://blog.csdn.net/zuoyanjie/article/details/5719957
lingjin520 2012-06-07
  • 打赏
  • 举报
回复
有意思

70,022

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧