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?
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
You mean like this?
Code:string str( "Hello World" ); cout << str.c_str();
thats right thanks!!!