Answers for "allocate more memory for dynamic string cpp"

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 "allocate more memory for dynamic string cpp"

Code answers related to "C"

Browse Popular Code Answers by Language