I am facing a problem in using the right shift operator in C with keil. The instruction is:for(i=0;i<=8;i++) { j=sum>>i; } where sum= 32 bit no. the instruction is not executed if the syntax is as shown above. but if i write a numerical value instead of using the variable name 'sum' then the instruction is easily executed. i need to use the variable name only. how do i fix this problem?
"Since i need to use only variable names in the code"
Why is that?
Despite many requests, you still have not explained why you need to do this shift in a loop, rather than simply
j = sum >> 8;