QUIZ 47

What is the ouput of?

char *ch[4];
printf(“%d,%d,%d”,sizeof(char *),sizeof(char),sizeof(ch));

a. 4,1,16
b. 2,1,16
c. 4,1,8
d.4,2,8

Answer : (a)

sizeof(char *) : size of pointer i.e. 4 or 2B
sizeof(char) : size of char i.e. 1B
sizeof(ch) : size of char pointer array of size 4
For 32 bit compiler : 4,1,16
For 16 bit compiler : 2,1,8

Leave a Reply

Your email address will not be published. Required fields are marked *