diff --git a/client/src/pages/guide/english/cplusplus/dynamic-memory-allocation/index.md b/client/src/pages/guide/english/cplusplus/dynamic-memory-allocation/index.md index 552e9203fd..c9efee93c8 100644 --- a/client/src/pages/guide/english/cplusplus/dynamic-memory-allocation/index.md +++ b/client/src/pages/guide/english/cplusplus/dynamic-memory-allocation/index.md @@ -17,7 +17,8 @@ title: Dynamic Memory Allocation `pointer-variable-type` = **new** `data-type;` Example 1: `int *ptr` = **new** `int;` Example 2: `int *ptr2` = **new** `int[10];` - Here, `pointer-variable-type` is a **pointer** of `data type`. The `data-type` can be int, char, etc. or user-defined data-type. + Here, `pointer-variable-type` is a **pointer** of `data type`. The `data-type` can be int, char, etc. or user-defined data-type. + * `new` is preferred over `malloc()` in C++ because new works for objects as well which is the main building block for OOPs. ### DELETE operator * It is programmer's responsibility to de-allocate the dynamically allocated memory otherwise the memory would not be available to be re-allocated until the end of the program.