Monday 23 February 2015

Pointer in C


#include<stdio.h>
#include<conio.h>
main()
{
int *p,a=100;
clrscr();
printf("\n Before Assigning");
printf("\n Address of a is :%x",&a);
printf("\n Adress of p is       :%x",p);
p=&a;
printf("\n after Assigning");
printf("\n Address of a is :%x",&a);
printf("\n Address of p is :%x",p);
*p=1000;
printf("\n Value of a is :%d",a);
printf("\n Value of p is :%d",*p);
getch();
}

No comments:

Post a Comment