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


Reserving bits for bit packing

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