Answers for "Suppose we have a dynamically allocated 2D-Array called X of m rows and n columns. What is the proper way to deallocate the memory associated with this array? You may assume the columns have already been deallocated."

C++
0

Dynamically allocate a string object and save the address in the pointer variable p.

#include <iostream>

int main()
{
string* p;
int n;

p = new string; // Dynamically allocate a string object and save the address in the pointer variable p.

}
Posted by: Guest on October-17-2020

Code answers related to "Suppose we have a dynamically allocated 2D-Array called X of m rows and n columns. What is the proper way to deallocate the memory associated with this array? You may assume the columns have already been deallocated."

Browse Popular Code Answers by Language