Thanks for the Union lead. In my C reference, it is unclear whether the 
variables will be unchanged when reinitializing the space from a char to a long 
and vice versa. Do the variables keep their same value? In other words will the 
long...0xFFEEEEDD, come out as 0xDD,0xEE,0xEE,0xFF if I re initialize the space 
as bytes??
Thanks again,
Ron


-----Original Message-----
From: Johann Glaser <johann.gla...@gmx.at>
To: sdcc-user@lists.sourceforge.net
Sent: Wed, 14 Jan 2009 12:56 pm
Subject: Re: [Sdcc-user] Typedef Structure



Hi!

Am Mittwoch, den 14.01.2009, 12:43 -0500 schrieb ronnym...@aol.com:
> I have created an eight byte variable structure in SDCC 2.8 using
> typedef. Is there a way to assign (alias) two unsigned longs to the
> structure so that I may manipulate the bytes as two 4 byte longs at a
> time?

The C construct "union" is your friend.
http://www.yolinux.com/TUTORIALS/LinuxTutorialC++Structures.html You can
nest structs and unions.

Bye
  Hansi



------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to