Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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());
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #string #char #array
ADD COMMENT
Topic
Name
7+3 =