Monday, 8 December 2014

C Program to view the size of an integer

Program to print addresses of integers
#include<stdio.h>
main()
{
int ch;
int *p=&ch;
printf("%d at %u\n",*p,&ch);
*p=100;
printf("%d at %u\n",*p,&p);
}
OutPut:
madan@madan-Lenovo-G570:~/madan$ cc ex52.c
madan@madan-Lenovo-G570:~/madan$ ./a.out
32767 at 503631812
100 at 503631816