What is the o/p of the following C-program?Main(){Char *str[] = { "Frogs"," do", "not", "die", "they", "croak!");Printf("%d %d",sizeof(str),sizeof(str[0]));}

This question is related to Oracle Interview

Showing Answers 1 - 16 of 16 Answers

Sibabrata behera

  • Dec 20th, 2006
 

24,5.it will print this one

  Was this answer useful?  Yes

Divya Dhankar

  • Dec 21st, 2006
 

This is array of pointer and a pointer size 4 bytesso array of pointer which is pointing to 6 stringswill be 24 and the str[0] pointing only one stringso it's size will be 4

Sriram

  • Apr 22nd, 2007
 

For me, on a Windows platform it displayed 12,2.
I guess for unix users, the allocation for a string is 4 bytes whereas for Windows its only 2.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions