String to char array

I mean I have the String s, and I want to initialize a char array from s, how could I do that?

Have you bothered to look at the String documentation?

Specifically, perhaps, the toCharArray() method?

Then, ditch the String class altogether. It can corrupt your program when the destructor calls free().