understanding pointers

#include<iostream>
using namespace std;
int main(){
int *point,**point1,***point2,****point3,a;
point=&a;
point1=&point;
point2=&point1;
point3=&point2;
cout<<"enter value of a "<<endl;
cin>>a;
cout<<endl;
cout<<" the value of a = "<<a<<" - and adress is = "<<&a<<endl<<endl;

cout<<" the value of a= "<<*point<<"- and adress is = "<<point<<endl<<endl;

cout<<" the value of a= "<<**point1<<"- and adress of pointer to a is = "<<point1<<endl<<endl;

cout<<" the value of a= "<<***point2<<"- and adress of pointer to pointer of a is  = "<<point2<<endl<<endl;

cout<<" the value of a= "<<****point3<<"- and adress of pointer to pointer to pointer of a is  = "<<point3<<endl<<endl;

}



Previous
Next Post »

Comments:

Disqus Shortname