C++ Convert String to Char Array

Here is the best and simplest way to go from a string to an array of characters in C++

Example Code:

std::string myString = “My Name is Sam”;
char *myCharArray = (char*)myString.c_str();