|
|
Dynamic Memory Allocation Function
|
Tutorials

Cpp

|
Topic |
How to allocate space using Dynamic Memory Allocation Function in C++?
|
|
Explanation |
|
Dynamic Allocation Function are used to allocate space or memory dynamically or at run time. The header file used by the
dynamic allocation functions is "<cstdlib>".
Different C++ compilers support these functions in different variants, to accommodate various options and
environmental differences. Following table lists some basic dynamic memory allocation function to allocate space.
| Name |
Description |
| calloc |
Allocates memory of the specified size |
| free |
Returns the memory pointed by the pointer. |
| malloc |
Returns a pointer to the first byte of the memory. |
| realloc |
Changes the size of the previously allocated. |
|
| Note |
C++ is one of the most used programming languages in the world. Also known as "C with Classes".
Hope you enjoy this tutorial. Do send your feedback or suggestions on this C++ tutorial. This is a copyright content.
|
|
|
|