Tuesday, September 28, 2010

Pointer Size in gcc Compiler

/*
* PointerSize.c
*
* Created on: Sep 29, 2010
* Author: Karthikeyan.D
*/
/* 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 four byte. (gcc Compiler)
*/
#include <stdio.h>
int main()
{
int *p1;
long double *p2;
printf("%d %d",sizeof(p1),sizeof(p2));

return 0;
}



OUTPUT:

4 4

No comments:

Post a Comment