A

Admin • 802.91K Points
Coach

Q. Which of the following is the correct way to allocate memory dynamically for an integer in C++?

  • (A) new int;
  • (B) malloc(int);
  • (C) allocate int;
  • (D) int new();
  • Correct Answer - Option(A)
  • Views: 4
  • Filed under category C++
  • Hashtags:

Explanation by: Admin
In C++, the 'new' operator is used to allocate memory dynamically. The correct syntax is 'new int;'.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.