C
Cindy
I am struggling over a simple way to shift multi bytes for certain
bits. Hope someone can help. For example, I open a memory space for 10
bytes:
unsigned char *pData = new unsigned char[10];
then store some value into pData which occupies pData[8] and pData[9].
Now I want to shift these two bytes to the left for 9 bits and still
store them in pData. The data now should span from the bit0 in
pData[6] to bit1 in pData[8].
Is there a fast way to do it?
Thanks,
Cindy
bits. Hope someone can help. For example, I open a memory space for 10
bytes:
unsigned char *pData = new unsigned char[10];
then store some value into pData which occupies pData[8] and pData[9].
Now I want to shift these two bytes to the left for 9 bits and still
store them in pData. The data now should span from the bit0 in
pData[6] to bit1 in pData[8].
Is there a fast way to do it?
Thanks,
Cindy