string = character array in c++ code example Example: c++ string with character array #include <cstring> strcpy(char_array, s.c_str());