In C++, the method used to allocate memory dynamically during runtime within the object is called _______.
- malloc
- new
- alloc
- reserve
In C++, dynamic memory allocation for objects is achieved using the new operator. Unlike malloc in C, new in C++ initializes the allocated memory.
Loading...
Related Quiz
- Which operator is used to compare if two values are equal in C++?
- Which of the following scenarios is the most suitable for using a break statement in a professional codebase?
- A pointer passed by value to a function allows the function to change the _______ to which the pointer points.
- What is the use of a catch block with an ellipsis (...)?
- What will happen if a function does not return a value but has a return type other than void?