for compiler giving 8 bit for pointers, shouldn't int also be of 8 bits?? On Thu, Jul 28, 2011 at 12:26 PM, Jnana Sagar <supremeofki...@gmail.com>wrote:
> @aditya..the answer may vary, because c is machine dependent > language..in few machines int is of 2 bytes and char is of 1 byte..u > can't say..it varies with diff machines > > On 7/26/11, aditya kumar <aditya.kumar130...@gmail.com> wrote: > > char *s[5] is a array of pointers of type char . but the thing is size of > > pointers is 4byte irrespective of its type . coz address is always an > > unsigned int which is of 4byte. > > On Tue, Jul 26, 2011 at 7:11 PM, Puneet Gautam > > <puneet.nsi...@gmail.com>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 <dondod...@gmail.com> 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 <puneet.nsi...@gmail.com> 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 algogeeks@googlegroups.com. > >> > To unsubscribe from this group, send email to > >> > algogeeks+unsubscr...@googlegroups.com. > >> > 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 algogeeks@googlegroups.com. > >> To unsubscribe from this group, send email to > >> algogeeks+unsubscr...@googlegroups.com. > >> 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 algogeeks@googlegroups.com. > > To unsubscribe from this group, send email to > > algogeeks+unsubscr...@googlegroups.com. > > 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 algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.com -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.