Re: [algogeeks] structure padding query

2011-11-26 Thread Dheeraj Jain
http://www.geeksforgeeks.org/archives/9705 On Fri, Nov 25, 2011 at 12:36 AM, rahul sharma rahul23111...@gmail.comwrote: struct abc { int g; float f; double gj; }; like in this int takes 4 bytes and we want align in 8 bytes so i wana know that whether the float should put with

[algogeeks] structure padding query

2011-11-24 Thread rahul sharma
struct abc { int g; float f; double gj; }; like in this int takes 4 bytes and we want align in 8 bytes so i wana know that whether the float should put with int as 4 bytes are there to complete 8 or float should be int+4 bytes padding and then store the float.. acc to o/p float is