In C language, a pointer is a variable that points to or references
a memory location in which data is stored. Each memory cell in the computer has
an address which can be used to access its location. A pointer variable points
to a memory location. By making use of pointer, we can access and change the contents
of the memory location.
A pointer is a variable which contains the address in memory of another variable. We can have a pointer to any variable type.
The unary or monadic operator & gives the ``address of a variable''.
The indirection or dereference operator * gives the ``contents of an object pointed to by a pointer''.
To declare a pointer to a variable do:
int x = 1, y = 2;
ip = &x;
y = *ip;
x = ip;
*ip = 3;
/* A program to illustrate pointer declaration
cout<<"\n sum variable value is "<<sum;
cout<<"\n The 'ptr' pointer variable value is "<<ptr;