@all : In any case , it sets the padding bytes according to the alignment of largest sized element in structure
on dev c++ double aligns on 8 bytes boundary .. (so output 24 bytes) whereas double aligns on 4 bytes boundary using gcc on linux... (so output 16 bytes) these are for 32 bit system.. but u compile it for a 64 bit system , output wud be 24 (as double aligns on a 8 byte boundary) correct me if i am wrong? On Sun, Aug 7, 2011 at 8:56 AM, coder dumca <[email protected]> wrote: > on gcc it is 16 bytes and on dev cpp its 24 bytes > > > On Sat, Aug 6, 2011 at 11:10 AM, siddharth srivastava <[email protected] > > wrote: > >> >> >> On 6 August 2011 23:27, Nitin <[email protected]> wrote: >> >>> I am also getting 24 bytes but y it is taking it every data type as 8,8,8 >>> as if we take it alone it is 1 for char and 4 for int and 8 for doble as it >>> is giving 24 which means it is setting every data type as 8 bytes. >>> >> >> it should be due to 64 bit machine (and I guess an appropriate compiler >> suiting the architecture) >> btw, what's your system architecture and compiler specifications ? >> >> >> >>> >>> On Sat, Aug 6, 2011 at 9:28 PM, Aditya Virmani < >>> [email protected]> wrote: >>> >>>> i guess it depends on ur system configuration...for 32 bit >>>> machines...respective sizes allocated would be 4,4,8 :giving 16 >>>> & on 64 bit machines it wud be 8,8,8: giving 24. Correct me if i am >>>> wrong. >>>> >>>> >>>> On Sat, Aug 6, 2011 at 9:24 PM, SANDEEP CHUGH >>>> <[email protected]>wrote: >>>> >>>>> @ sukran , nitish : >>>>> guys, i dnt knw about the output from these online compliers.. >>>>> >>>>> >>>>> On Sat, Aug 6, 2011 at 9:20 PM, SANDEEP CHUGH <[email protected] >>>>> > wrote: >>>>> >>>>>> >>>>>> @payel : according to u,,starting address cannot be 4.. ok. >>>>>> but wat if i hav used the following structure before that structure >>>>>> >>>>>> struct demo1 >>>>>> { >>>>>> char a; >>>>>> int b; >>>>>> char c; >>>>>> >>>>>> } >>>>>> >>>>>> >>>>>> On Sat, Aug 6, 2011 at 9:06 PM, Nitish Garg < >>>>>> [email protected]> wrote: >>>>>> >>>>>>> Why does Ideone https://ideone.com/1Uwxx gives 16? >>>>>>> >>>>>>> -- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "Algorithm Geeks" group. >>>>>>> To view this discussion on the web visit >>>>>>> https://groups.google.com/d/msg/algogeeks/-/L-zANxDDTUQJ. >>>>>>> >>>>>>> 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. >>>>> >>>> >>>> -- >>>> 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. >>> >> >> >> >> -- >> Regards >> Siddharth Srivastava >> >> >> >> -- >> 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. > -- 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.
