+ 4
How do you deal with shift in cpp?
let's assume this sample code... jump to the point... int x= 5; //using a shift right or left... //is it cout << <<x; //or x=<<x; cout<<x;
2 Answers
+ 4
When bitshifting, you always have to specify by how much you want to shift.
cout << (x << 1);
Shifts left by 1 bit and prints the result.
+ 3
thanks..