padding.. 4 byes int + 3 padding bytes + 5 char bytes + 4 bytes pointer =16
On Tue, Jul 26, 2011 at 7:22 PM, Puneet Gautam <[email protected]>wrote: > for the above mentioned code, in previous post,: shudnt the output be > 4+5+4=13? > > On 7/26/11, Prem Krishna Chettri <[email protected]> wrote: > > Its Cos that is pointer and all pointers is 4 bytes address.. > > > > On Tue, Jul 26, 2011 at 7:11 PM, Puneet Gautam > > <[email protected]>wrote: > > > >> @everyone: > >> I have this mind strangling doubt..!!! > >> > >> Why is "char *s[5]" of 20 bytes...? > >> > >> yes the output is 28... > >> > >> On 7/26/11, Don <[email protected]> wrote: > >> > A reasonable guess would be 28 bytes. But the size of a structure is > >> > implementation dependent, and therefore, some other result could be > >> > correct as well. > >> > Don > >> > > >> > On Jul 26, 7:40 am, Puneet Gautam <[email protected]> wrote: > >> >> #include<stdio.h> > >> >> #include<stddef.h> > >> >> struct node{ > >> >> int a; > >> >> char *b[5]; > >> >> struct node *link; > >> >> }; > >> >> main() > >> >> { > >> >> int a; > >> >> a=sizeof(struct node); > >> >> printf("%d",a); > >> >> getchar(); > >> >> return 0; > >> >> } > >> >> > >> >> Whats the output..? > >> > > >> > -- > >> > 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. > > > > > > -- > 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.
