H
horvatj
Hi there!
I have a very silly shift operation question:
My test code does something like this:
int j=1;
int y=0;
int i=0;
int bs=0;
for(i=0;i<16;i++){
bs=1<<j;
y=?????;
printf("%i:\tj=%i\tbs=%i\t\ty=%i\n", i, j, bs, y);
j++;
}
I want y to be the bit set in bs=1<<j - I know usally done by y=j...
But in my real application I have a bs=1024 or bs=512 and have to
determine the y...
Thanx a lot!
Johann
I have a very silly shift operation question:
My test code does something like this:
int j=1;
int y=0;
int i=0;
int bs=0;
for(i=0;i<16;i++){
bs=1<<j;
y=?????;
printf("%i:\tj=%i\tbs=%i\t\ty=%i\n", i, j, bs, y);
j++;
}
I want y to be the bit set in bs=1<<j - I know usally done by y=j...
But in my real application I have a bs=1024 or bs=512 and have to
determine the y...
Thanx a lot!
Johann