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

How to convert a string to and char array

P: 9
Hi,
Can anyone plz tell me how to do this conversion:

I have a string array str[10];
str[0],str[1],.....str[9] are all having strings.

I just want to convert one string, say str[0], to characters!!!!

I would appreciate your responses!
Thanks,
Asad/
Oct 3 '06 #1
Share this Question
Share on Google+
2 Replies


100+
P: 293
D_C
If you are using the STL string, there is a method c_str(). Then, you could just call ((str[0]).c_str()).
Oct 3 '06 #2

P: 9
If you are using the STL string, there is a method c_str(). Then, you could just call ((str[0]).c_str()).
Thanks,
I got the conversion.

-Asad.
Oct 3 '06 #3

Post your reply

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