each object in the structure will take one memory word.(if one object then its size of that object) Thank you, Sid.
On Sat, Sep 3, 2011 at 10:27 PM, Debabrata Das < [email protected]> wrote: > how output is 12 on typical 32 bit system and why? > #include<stdio.h> > struct x > { > int y; > char x; > float z; > }; > main() > { > printf("%d",sizeof(struct x)); > } > > what is the rule of padding.... > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
