Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
下面程序的输出是0,但是为什么呢?
#include <stdio.h> #include <conio.h> int main() { int x=5; printf("%d",x!=5); getch(); }
False 打印为0.
0
x!=5是假的,因此%d会打印0,如果你这样做x==5,它会打印1。
x!=5
%d
x==5
1
http://codepad.org/t8DAMu3A