【发布时间】:2021-03-15 03:30:38
【问题描述】:
当我在没有\n 的情况下运行此代码时,输出是hello5,但使用\n 时,输出是hello6,有人可以解释一下吗?
#include <stdio.h>
//Compiler version gcc 6.3.0
int main()
{
int c;
c = printf("hello\n");
printf("%d",c);
return 0;
}
【问题讨论】:
-
试试
c = printf("hello++");,你会开始注意到一个规律。 -
是的,当我这样想的时候,它是有道理的。