Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Int into binary 1

Status
Not open for further replies.

Malcav

Programmer
Oct 7, 2005
43
GB
hi
I have an integer i.e. 194 and I need to take the first 6 binary values and turn that into a number.
Have done a search but there was not much helpful info.
Thanks in advance
Malcav
 
Well
Code:
sixbits = myint & 0x3f;
gets the least significant 6 bits.

Code:
myint >>= 6;
moves the next 6 bits into position.

--
 
can explain what exactly means the operator >>= in this context?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top