Program to show working of Pointers in C & explain Concept of Pointers


main()
{
int x, *p, y;
clrscr();
x=10;
p=&x;
y=*p;
printf("Value of X: %d\nValue of P: %u\nValue of Y: %d",x,p,y);
printf("\nAddress of X: %u\nAddress of P: %u\nAddress of Y: %u",&x,&p,&y);
*p=20;
printf("\nNow Value of X: %d and Y: %d",x,y);
getch();
}

No comments:

Post a Comment