[英]Assigning a printf statement to a int variable
See the following code:请参阅以下代码:
int i={
printf("c" "++")
};
it prints c++ and returns 3 to i.它打印 c++ 并将 3 返回给 i。 how it is assigning 3 to i?
它是如何将 3 分配给 i 的? need explanation!
需要解释!
printf
returns the number of bytes written to stdout
. printf
返回写入stdout
的字节数。 "c++"
is exactly three bytes long (not counting the null-terminator). "c++"
正好是三个字节长(不包括空终止符)。
By the way, you really don't need to use the curly braces, you can simply do int i=printf("c" "++");
顺便说一句,你真的不需要使用花括号,你可以简单地做
int i=printf("c" "++");
. .
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.