Pointers Overview and Need
We declare simple variables in C++ by the statements like :
int a ; // an un-initialized integer variable
float b ; // an un-initialized float variable
char MyVote = ‘Y’ ; // a initialized character variable
All of the above variables that we have declared are termed as simple programming variables (You learned about them in Class XI).The concept of pointer is not new in C++, it has been there in right from the generation of Language – C. Language C is considered as one of the most efficient middle level programming language, because of its ability to write codes for hardware devices, like CPU , Disk Drives, Keyboards etc.One of the facilities in C which provided it these capabilities was the presence of Pointers with it.
Following are some of the application area domains where a Pointer concept could be applied:
- Writing Device Drivers (a middle ware).
- Communicating with Network and I/O devices.
- Implementing complex Data Structures Like Stack ,Link – List , Queue etc.(which you will read after this chapter)
- Implementing many complex algorithms faster.