0
What does ~ mean in a logic operation?
Just going through some random questions, I got stuck in this. The program is as follows: int main() { bool a = true; bool b = false; bool c = ~(a&&b) cout<< c; return 0; } I wonder what is the function of ~ operator. Please help.
1 ответ
+ 7
Tilde (~) is the bitwise complement operator. It takes the compliment of a binary value and adds a binary one to it.
https://stackoverflow.com/questions/791328/how-does-the-bitwise-complement-operator-work