Viii) main(){ char *p; printf("%d %d ",sizeof(*p),sizeof(p));}

1 2
Explanation:
The sizeof() operator gives the number of bytes taken by its operand. P is a character pointer, which needs one byte for storing its value (a character). Hence sizeof(*p) gives a value of 1. Since it needs two bytes to store the address of the character pointer sizeof(p) gives 2.

Questions by Beena   answers by Beena

Showing Answers 1 - 10 of 10 Answers

sreelu

  • Mar 15th, 2006
 

ans :1,2 because the *p is the pointer varible but the type is character.p is apointer variable.

  Was this answer useful?  Yes

divya

  • Dec 21st, 2006
 

answer will be 1,41 is sizeof char4 is size of pointer

aniljoo

  • Feb 12th, 2007
 

ans is 1 & 2 bcoz *p is pointing to some char data which must be 1 byte and size(p) is 2 byte bcoz it is holding the address which is an integer

  Was this answer useful?  Yes

satyajitdas

  • Aug 18th, 2007
 

ans is->1 4 as *p will give the value and char is 1 byte but p will print 4 because its an address so it will print 4 bytes

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