C Programming help .....wtf ?!?!

Ben Duncan bns
Tue Jan 25 15:16:39 PST 2005


Why does the sizeof( struct _dummymenu) on the below
return 8 ?


   typedef struct _dummymenu
        {
        char d_char ;
        int d_sumnumber ;
        } DummyMenu ;

Yet if I do one a structure like this:

typedef struct _dummymenu
        {
        char a_char ;
        char b_char ;
        char c_char ;
        } DummyMenu ;

it returns 3 ......

-- 
Ben Duncan   - VersAccounting Software LLC 336 Elton Road  Jackson MS, 39212
"Never attribute to malice, that which can be adequately explained by stupidity"
        - Hanlon's Razor



More information about the Linux-users mailing list