• Advertisement


This topic is now archived and is closed to further replies.

Reserving bits for bit packing

This topic is 5943 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello int a; a=(a & ~(63<<6))|(25<<6); this reserves the first 6 bits of the integer now when i wanna use the next 6 bits should i do it somehow like that a=(a & ~(4095<<12))|(25<<12); and how can i get the values then??? sprintf(sz,"%d",(a&(1>>6)));//for the first 6 bits sprintf(sz,"%d",(a&(64>>12)));//for the second 6

Share this post

Link to post
Share on other sites

  • Advertisement