Professional Documents
Culture Documents
Answer: Size of any type of pointer is independent of the data type which is it is pointing i.e. size of pointer is always fixed. Size of any type (near) of pointer in c is two byte. For example: #include<stdio.h> void main(){ int *p1; long double *p2; printf("%d %d",sizeof(p1),sizeof(p2)); } Output: 2 2 Since both pointers int and long double are pointing to only first byte of int data and long double data respectively.
Hence both int pointer and long double pointer stores only address in 16 bits. Thus both of them will occupy exactly equal memory space.
at 11:11 PM 37 comments Links to this post
Answer: Size of any type of pointer in c is independent of type which is pointer is pointing i.e. size of all of pointer (near) in c is two byte either it is pointer, double pointer, function pointer or pointer. Void pointer is not exception of this and size of void pointer is also two byte.