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.
Peter Vegas
Leave a Reply
Get the latest updates on your inbox
Be the first to receive the latest updates from Codesdoc by signing up to our email subscription.