I do not think I am using the "shift" correctly in my program ? I am trying to cycle the bytes so I would get the value of the bit pattern once I shift the bytes. something to the effect :
01 00 00 00 = 1
once it hit FF it would "shift" the bytes so I would get :
00 01 00 00 = 256
00 02 00 00 = 512
and so on ...................
I am thinking about adding a function and not trying to do it all in the main ? Anyone have any ideas ? Thank you for the help!
Code:
#include <stdio.h>
int main()
{
int i;
for (i =0; i< 256; i++)
printf( "The Value is: %02X 00 00 00 %14d %14u\n", i,i,i);
if ( i == 255)
i = i >> 2;
for (i =0; i< 256; i++)
printf( "The Value is: 00 %02X 00 00 %14d %14u\n", i,i,i);
if ( i == 255)
i = i >> 2;
for (i =0; i< 256; i++)
printf( "The Value is: 00 00 %02X 00 %14d %14u\n", i,i,i);
if ( i == 255)
i = i >> 2;
for (i =0; i< 256; i++)
printf( "The Value is: 00 00 00 %02X %14d %14u\n", i,i,i);
getch();
return (0);
getch();
}