AnsweredAssumed Answered

Problems using uint_16 in a structure

Question asked by Michael Predko on Sep 25, 2010
Latest reply on Sep 25, 2010 by Michael Predko

Hey Folks,

 

I'm having a problem specifying a 16 bit field in a structure.  When I declare:

typedef struct myfiles_def_struct {

 

 

 

    // Block Header

    uint_16 FHDR;

 

    // Size of data Block

    uint_32 FSIZE;

 

    // 8 Character Block Identifier

    uint_8 FNAME[8];

 

    // Block Data/size specified by “FSIZE” 

    uint_8 FDATA[]; 

 

} MYFILES_DEF_STRUCT, _PTR_ MYFILES_DEF_STRUCT_PTR;

 

 

the offset for "FSIZE" is 4 from "FHDR" and not 2 like I would expect. 

 

I've searched the CW as well as the MQX forums for people who have found similar issues but with no luck. 

 

Any ideas?  I feel like I'm missing something incredibly basic here. 

 

Thanx,

 

myke

Outcomes