Quick actions

cmd+k|ctrl+k

Navigation

Languages

Bit operators / ~ - bitwise NOT (unary complement) / Essential C++

Snippet info

Language

Cpp

Visibility

public

Author

kkowalczyk

Created

2019-03-27T06:44:25Z

Updated

2019-03-27T06:44:25Z

#include <iostream>

int main(int argc, char **argv) {
    unsigned int i = ~0;
    unsigned char c = ~0;
    
    std::cout << "max uint = " << i << std::endl <<
                 "max uchar = " << static_cast<short>(c) << std::endl;
}
INFO