Monday, 8 December 2014

C program to address of pointers

program to check addresses using pointers
#include<stdio.h>
main()
{
int a=65,b=67,*var;
printf("b=%d at %u\n",b,&b);
var=&b;
printf("var=%d at %u\n",var);
printf("var=%d at %u \n",*var);
}
OutPut:
madan@madan-Lenovo-G570:~/madan$ cc ex47.c
madan@madan-Lenovo-G570:~/madan$ ./a.out
b=67 at 4180353072
var=-114614224 at 2893998576
var=67 at 2893998576