Answers for "how to copy a string into dynamic memory allocation c++"

C
1

dynamic memory allocation for string in c++

string* str_arr = nullptr;
str_arr = new string[10];

//initialize
str_arr[0] = "Hello";
str_arr[1] = " World!";
Posted by: Guest on January-30-2022

Code answers related to "how to copy a string into dynamic memory allocation c++"

Code answers related to "C"

Browse Popular Code Answers by Language