Hi, 

First, sorry for my English.

I want to use operator << or >> to run a bit all positions of a char 
variable. My problem is when the bit reaches the end of the variable. 
When I use the operator again, the variable char clear all bits of the 
variable. 
Example: 
c = 1 (00000001) 
c = c <<1; 
then c = 2 (00000010) 
c = c <<1; 
then c = 4 (00000100) 
... 
then c = 128 (10000000) 
c <<1; 
then c = 0 (00000000) 

I want in this time that the variable c is not zero but return c = 1, 
to begin the process ... 
How to do this without having to check the condition c == 128 and then 
do c = 1? 
Is there some automated way? 

tks,
Rodrigo




Reply via email to