In: Computer Science
Topic: The concept of pointers in C++ is inherited from the C language, which relies extensively on the use of pointers. What are the advantages and disadvantages of having the functionality of pointers in a programming language?
Pointer Variable:
A pointer variable is a special type of variable that is used to store the address of another variable which has a similar data type as the pointer data type. The dereferenced operator '*' is used to access the value stored at that location that is stored by the pointer variable.
For example:
int a = 10;
int *b = &a;
Here, the variable 'b' is a pointer variable that stores the address of an integer type variable.
Advantages:
Disadvantages: