printing most sig byte...??
I have a pointer p that contains a valid address and am trying to print the MS 8 bits... since there isn't a way to do that in printf that i know of, i'm using a loop and it looks like...
Code:
for(i=0; i<8; i++)
{
if(*p & 0x80)
printf("1");
else
printf("0");
*p<<1;
}
however this either prints either 8 1's or 8 0's... I know that it's just not the way the numbers are b/c i have functions that print the numbers in decimal and hex and those work fine... any ideas?
John
Re: printing most sig byte...??
*p<<1;
Instead, try
*p <<= 1;