how can i convert variable to another. especially string to char?
This is a discussion on convertion question within the C++ Programming forums, part of the General Programming Boards category; how can i convert variable to another. especially string to char?...
how can i convert variable to another. especially string to char?
A string consists of (typically) many characters. How would you propose converting that to a single character? Or do you mean simply to parse the string into its component characters?
I used to be an adventurer like you... then I took an arrow to the knee.
You mean like this?
Code:string str( "Hello World" ); cout << str.c_str();
thats right thanks!!!