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

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 "Dynamically allocate a string object and save the address in the pointer variable p."

Browse Popular Code Answers by Language