C size of void pointerPritesh
What is the size of Void Pointer variable in C ?
Pointer is the variable that stores the address of another variable .
How to calculate size of Pointer ?
- Size of Void Pointer can be evaluated by using sizeof operator
- Pointer stores the address of the Variable .
- Address of variable is nothing but the integer value .
- In C , for storing integer value 2 bytes are required .
- So void Pointer variable requires 2 bytes of memory.
int num = 0;
num = 15;
ptr = #
/* Output the size */
printf("Size of Pointer : %d Bytes",sizeof(pointer));
Size of Pointer : 2 Bytes
Bookmark & Share