Am 05.05.2011 09:10, schrieb Krishnendu Chatterjee:
> Hi,
> 
> My solution would be:
> 
> #include <stdint.h>
> 
> union […]

This seems to be the best so far, but none of the presented "solutions"
from this thread is portable or good C. Here's one that is:

unsigned char c[sizeof(unsigned long)];
unsigned long i;

memcpy(c, &i, sizeof(unsigned long));
memcpy(&i, c, sizeof(unsigned long));

Philipp

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to