[Icc-avr] Casting

Johan Wallström johan at edab.nu
Sun Jan 20 06:41:45 PST 2008


> Andrew wrote:
>> Hi,
>>
>> When casting and int to two char' (a MSB and LSB) is it safe to do the
>> following:-
>> Data[7] = (Channel_One >> 8);
>> Data[8] = (Channel_One);
>>

I always use the above solution, it should be perfectly legal and it has 
never failed me on any compiler. I think it is quite clear for any 
programmer of embedded systems what this does.

regards
Johan 




More information about the Icc-avr mailing list