[algogeeks] Structural Padding in C

2012-02-29 Thread Decipher
I need some help in understanding how padding works ?? Please answer the following questions with proper explanations.. struct mystruct1 { char a; int b; short c; long d; }; struct mystruct2 { char a; short b; char c; long d; }; What's the sizeof above 2 structures and why ??

Re: [algogeeks] Structural Padding in C

2012-02-29 Thread atul anand
hope this helps http://www.geeksforgeeks.org/archives/9705 On Wed, Feb 29, 2012 at 9:43 PM, Decipher ankurseth...@gmail.com wrote: I need some help in understanding how padding works ?? Please answer the following questions with proper explanations.. struct mystruct1 { char a;