Can I use the not operator in C++ on int values?

后端 未结 5 894
有刺的猬
有刺的猬 2021-01-04 03:16

Strange question, but someone showed me this, I was wondering can you use the not ! operator for int in C++? (its strange to me).

#include 
u         


        
5条回答
  •  被撕碎了的回忆
    2021-01-04 03:51

    The test for int is true for non-zero values and false for zero values, so not is just true for zero values and false for non-zero values.

提交回复
热议问题