@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 <[email protected]> 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
> <[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.

Reply via email to