#include<iostream.h>
#include<conio.h>
void main()
{
                int *ptr[5];
                int i,a=2,b=4,c=6,d=8,e=10;
                clrscr();
                ptr[0]=&a;
                ptr[1]=&b;
                ptr[2]=&c;
                ptr[3]=&d;
                ptr[4]=&e;
                for(i=0;i<5;i++)
                                {
                                cout<<"Value of Ptr["<<i<<"] = "<<(unsigned)ptr[i]<<endl;
                                cout<<"Value of *Ptr["<<i<<"] = "<<*ptr[i]<<endl;
                                }
                getch();
}

115

Advertisements