By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,898 Members | 2,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,898 IT Pros & Developers. It's quick & easy.

String to char

P: 31
i was wondering if any one can help me i am trying to covert a string to a char if anyone has an idea let me know thanks
Feb 23 '07 #1
Share this Question
Share on Google+
2 Replies


DeMan
100+
P: 1,806
A string is an array of chars....

You can get any character out of the string bt iterating through the characters beyond the start of the string
Feb 23 '07 #2

Ganon11
Expert 2.5K+
P: 3,652
If you mean converting a string (std::string) to a character array (char string[]), you can use the .c_str() method in the string class - it will return the character array stored inside the string object.
Feb 24 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.