Converting string into character arrays

K

kittykat

Hi,
I was just wondering how can I convert a String into a char array?

Your help would be greatly appreciated,
Thanx in advance.
 
H

Howard

kittykat said:
Hi,
I was just wondering how can I convert a String into a char array?

Your help would be greatly appreciated,
Thanx in advance.

That depends: what's a "String"? If you mean the class called "string",
first notice that it is spelled with a lower case "s", which is very
important in C++. And in that case, you can call the c_str() function in
the string class to get a pointer to the character array, from which you are
free to copy to your own char array if you need. If you mean some other,
third-party class called "String", then you'd be best off asking the
creators of that class, or reading their manual.

-Howard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top