Yahoo Answers is shutting down on 4 May 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
How to convert String array to char array?
How to convert a String array to a double char array.
String []str into char [][]str
How to convert a String array to a double char array in java.
String []str into char [][]str
4 Answers
- 1 decade agoFavourite answer
write this in your code :
char [][]target;
target = new char[str.length][];
for(int i=0;i<str.length;i++)
target[i] = str[i].toCharArray();
this code will turn your string[] named str to char[][] named target
- 5 years ago
Use the c_str() approach of the string type to get on the underlying C string: string timmy = "abc"; char *johnny; johnny = timmy.c_str(); Or, in case you fairly do ought to repeat the completed string: string timmy = "abc"; char johnny[4]; strcpy(johnny, timmy.c_str());