We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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?
"the above instruction is not executed using the variable name 'sum'"
Just a thought: have you checked that 'sum' hasn't been defined with some special meaning, etc...
What if you call it 'my_sum' or something?
yeah i have checked that too. even if i replace 'sum' by any other varible name say 's' or 'x' or whatever, it is still not executed