C语言中的!!

C语言中!!的作用是?看例子;

复制代码
 1 #include <stdio.h>
 2 
 3 int main()
 4 {
 5    int test = 666;
 6 
 7    printf("test=%d !test=%d !!test=%d\n", test, !test, !!test);
 8 
 9    return 0;    
10 }
复制代码

 

output

test=666 !test=0 !!test=1

 

posted @   AlexAlex  阅读(1396)  评论(0)    收藏  举报
点击右上角即可分享
微信分享提示