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 @ 2019-10-28 09:01  AlexAlex  阅读(1338)  评论(0编辑  收藏  举报