Hello, I have a question about bitwise operators, especially shifting.
Suppose we have:
#include <iostream>
using namespace std;
int main() {
unsigned i = 2;
i<<=2;
cout << i << endl;
}
unsigned i = 2 in binary is 0.......00010, if we shift 2 bits to the left we will get 8, which is 0.......01000.
How can we print out or change bits using shift opertars(<<, >>)?
Thanks in advance