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 CCS Technical Support

order of members inside struct

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







order of members inside struct
PostPosted: Wed Jun 20, 2007 1:40 pm     Reply with quote

I want to have a struct where the relative order of the members is defined. Is this possible in C? Like below where I want "a" to accupy adress 0, b adress 1-2, c adress 3-6 and d adress 7. I have heard that the internal order of structs is not defined in c, can I make it defined somehow?

Code:

struct {
  int8 a;
  int16 b;
  int32 c;
  int8 d;
} affe;
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jun 20, 2007 1:49 pm     Reply with quote

http://www.ccsinfo.com/forum/viewtopic.php?t=26255&highlight=structure+order
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