Quick actions

cmd+k|ctrl+k

Navigation

Languages

Bit operators / | - bitwise OR / Essential C++

Snippet info

Language

Cpp

Visibility

public

Author

kkowalczyk

Created

2019-03-27T06:43:57Z

Updated

2019-03-27T06:43:57Z

#include <iostream>
#include <string>

int main(int argc, char **argv) {
    int a = 5;     // 0101b  (0x05)
    int b = 12;    // 1100b  (0x0C)
    int c = a | b; // 1101b  (0x0D)
    
    std::cout << "a = " << a << ", b = " << b << ", c = " << c << std::endl;
}
INFO