The new and delete Operators
Instead of pointing to an already existing variable it is possible to allocated new memory sufficient to hold a variable of a specific type
This is done using the new operator
To free the space use the delete operator
Example:
- int *n;
- n = new int;
- delete n;
-
Variables created using the new operator are called dynamic variables