Answers for "c++ array of chars to string"

C++
0

character array to string c++ stl

char arr[] = "mom";
std::cout << "hi " << std::string(arr);
Posted by: Guest on July-11-2021
3

c++ string to char array

const char *array = tmp.c_str(); //For const char array
char *array = &tmp[0]; // If you need to modify the array
Posted by: Guest on September-28-2020

Code answers related to "c++ array of chars to string"

Browse Popular Code Answers by Language