Multiple choice general knowledge science & technology

What is the keyword used to allocate memory in C++?

  1. dalloc

  2. calloc

  3. malloc

  4. new

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In C++, the 'new' keyword is the standard operator for dynamic memory allocation. While malloc and calloc are C functions that can be used in C++, 'new' is the preferred C++ approach because it calls constructors and is type-safe. 'dalloc' is not a standard memory allocation function in C or C++.