0% found this document useful (0 votes)
3 views3 pages

BitwiseOpt - 38

Bitwise operators in C++ operate on individual bits of data rather than whole data units, with available operations including AND, OR, XOR, NOT, left shift, and right shift. These operators are particularly useful in device drivers, systems programming, and applications closely related to electronics. Left and right shifts manipulate the bits, effectively multiplying or dividing the number by powers of two, while the signed bit is not affected in the process.

Uploaded by

nhpnhi.starcup
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

BitwiseOpt - 38

Bitwise operators in C++ operate on individual bits of data rather than whole data units, with available operations including AND, OR, XOR, NOT, left shift, and right shift. These operators are particularly useful in device drivers, systems programming, and applications closely related to electronics. Left and right shifts manipulate the bits, effectively multiplying or dividing the number by powers of two, while the signed bit is not affected in the process.

Uploaded by

nhpnhi.starcup
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

c++

Bitwise Operator

• These operators are performed on the bits of the data and


not as the single whole data unit

• The operations available here are

& - and

| - or

^ - xor

~ - not

<< - left shift

>> - Right Shift

• Its working
• If you are making device drivers , systems program, System
application , core system program and in general if a person is
working more close towards electronic there this operator is used
• Left and Right shift

int x = 5 , y;

X= 0 0 0 0 0 1 0 1

0 0 0 0 0 1 0 1

• When you shift all the bits on left hand side by one space then 5 will
get multiplied by 2 , if you move them by 2 space it will be multiplied
by 4

• Here signed bit is not included , if the number is positive then it will
be positive and vice versa

You might also like