Tuesday, 24 February 2015

Pointer Using C++

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

No comments:

Post a Comment