CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

removing union

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








removing union
PostPosted: Sat Jan 27, 2007 6:26 pm     Reply with quote

i woul like to know how to remove the union in this short extract of code. i have no idea. any suggestion would great.
thanks

{
char rata;

union {
unsigned short cookie;
struct {
char LowByte;
char HighByte;
};
};
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Jan 27, 2007 11:18 pm     Reply with quote

It's tough to know what you want. What would you like to see after
the union is "removed" ?

Also, be aware that an "unsigned short" is an unsigned 16-bit integer
in most C compilers. But in CCS, a "short" is a 1-bit variable.
To translate an "unsigned short" from a normal C program to CCS,
you would change it to an "int16" in CCS.
Ttelmah
Guest







PostPosted: Sun Jan 28, 2007 3:37 am     Reply with quote

Also, as posted, it also doesn't make any sense. The union has no 'name', so couldn't be accessed...

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group