#include<iostream>
using namespace std;
int main()
{
int a=4;
int* b=&a;
// & is address of operator
cout<<"Thr address of a is "<<&a<<endl;
cout<<"Thr address of a is "<<b<<endl;
// * is value at dereference operator
cout<<"Thr value of a is "<<*b<<endl;
// Pointer to pointer
int** c=&b;
cout<<"The adress of b is"<<&b<<endl;
cout<<"The adress of b is"<<c<<endl;
cout<<"The value at address c is "<<*c<<endl ;
cout<<"The value at address value_at (value_at( c )) is "<<**c<<endl;
}
OUTPUT =>
Thr address of a is 0x28ff28
int array[]={20,25,30,40,45,50};
int* p=array;
while(*p<=array[5])
{
cout<<"Value when p is "<<p<<"is "<<*p<<endl;
p=p+1;
}
OUTPUT =>
Value when p is 0x28ff08is 20
Value when p is 0x28ff0cis 25
Value when p is 0x28ff10is 30
Value when p is 0x28ff14is 40
Value when p is 0x28ff18is 45
Value when p is 0x28ff1cis 50