Pointer Variable = Pointer Variable + Increment * Base Type

#include<iostream.h>
#include<conio.h>
void main()
{
                int a=10,*iptr;
                char c,*cptr;
                double d,*dptr;
                clrscr();
                iptr=&a;
                cptr=&c;
                dptr=&d;
                cout<<"Value of iptr = "<<(unsigned)iptr<<endl;
                cout<<"Value of cptr = "<<(unsigned)cptr<<endl;
                cout<<"Value of dptr = "<<(unsigned)dptr<<endl;
                iptr++;
                cptr+=3;
                dptr-=5;
                cout<<"iptr = "<<(unsigned)iptr<<endl;
                cout<<"cptr = "<<(unsigned)cptr<<endl;
                cout<<"dptr = "<<(unsigned)dptr<<endl;
                getch();
}

105

Advertisements