Code
std::string myWord = "myWord";
char myArray[myWord.size()+1];//as 1 char space for null is also required
strcpy(myArray, myWord.c_str());
You will need to parse out the spaces yourself with a regex or string replace function.
I would use the string iterator and string erase method to do this.
Code
std::string::iterator end_pos = std::remove(str.begin(), str.end(), ' ');
str.erase(end_pos, str.end());
The first finds all locations of space, and the second deletes them all until the end of the string.