string to arrray c++ code example
Example 1: string to char array c++
std::string myWord = "myWord";
char myArray[myWord.size()+1];//as 1 char space for null is also required
strcpy(myArray, myWord.c_str());
Example 2: how to input a string into a char array cpp
strcpy(my_array, my_string.c_str());