Answers for "copy string into char array"

27

java string to char array

String str = "example";
char[] ch = str.toCharArray();
Posted by: Guest on March-05-2020
10

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());
Posted by: Guest on August-27-2020

Code answers related to "copy string into char array"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language