cpp pointer

Pointer in C++

Current Status
Not Enrolled
Price
$2.99
Get Started

First of all: The direct use of pointers can be dangerous and occasionally lead to errors even for experienced programmers. This is why you should be very careful when using pointers.

Pointers are necessary to use dynamically allocated memory. In other words a pointer is a variable whose content contains the position of another variable in main memory. A pointer variable is used to refer to and access memory contents indirectly.
Pointers are important for efficient and machine-oriented programming.

The use of pointers in C++ has some advantages:
The reference to a memory address usually requires less memory than the value that is referenced. Furthermore, it is possible to manipulate values at different positions in memory. The memory can be reserved and released. The control over memory management facilitates the implementation of data structures like stacks or lists. Pointers can have any data type such as int, float, char, etc.