Coupon Accepted Successfully!



Many learners feel that pointers is a puzzling topic. However, pointers can make programs quicker, straightforward, and memory efficient. C/C++ gives more importance to pointers. Hence, it is important to know the operation and applications of pointers. Pointers are used as tools in C/C++ and if you fail to understand them, you will lose the power of C/C++.
Similar to C, in C++, variables are used to hold data values during program execution. When declared, every variable occupies certain memory locations. It is possible to access and display the address of the memory location of a variable using ‘&’ operator. Memory is arranged in series of bytes. These series of bytes are numbered from zero onward. The number specified to a cell is known as memory address. A pointer variable stores the memory address of any type of variable. The pointer variable and normal variable should be of the same type. The pointer is denoted by (*) asterisk symbol.
A byte is nothing but a combination of eight bits, as shown in Figure. The binary numbers 0 and 1 are known as bits. Each byte in the memory is specified with a unique (matchless) memory address. The memory address is an unsigned integer starting from zero to uppermost addressing capacity of the microprocessor. The number of memory locations pointed by a pointer depends on the type of the pointer. The programmer should not worry about the addressing procedure of the variables. The compiler takes care of this. The pointers are either 16 bits or 32 bits long.
Fig: Memory representation
The allocation of memory during program run time is called dynamic memory allocation. Such a type of memory allocation is essential for data structure, and it is efficiently handled by pointers. Arrays are another reason for using pointers. Arrays are used to store more values. Actually, the name of the array is a pointer. Command-line arguments are one more reason for using pointers. These arguments are passed to programs and are stored in an array of pointers argv [].


A pointer is a memory variable that stores a memory address. Pointers can have any name that is legal for other variables, and it is declared in the same fashion as other variables, but it is always denoted by ‘*’ operator.

Test Your Skills Now!
Take a Quiz now
Reviewer Name