The One's Complement Operator - C++ Operator

C++ examples for Operator:Bit Operator

Introduction

The operator ~ can flip all of the bits in a variable.

Demo Code

#include <iostream> 
  
using namespace std; 
  
int main(int argc, char *argv [])
{ 
        int test = 0x0000000F; 
        cout << hex << ~test; 
        return 0; 
}

Result


Related Tutorials