DarkMoose
Nov 23rd, 2001, 11:44 AM
char myChar;
string s = "penguin";
myChar = s.substr(3, 1);
The idea is for myChar to have the value of 'g' after this, but I get an error because s.substr(3, 1); is still considered a string. How can I convert that letter into a character?
string s = "penguin";
myChar = s.substr(3, 1);
The idea is for myChar to have the value of 'g' after this, but I get an error because s.substr(3, 1); is still considered a string. How can I convert that letter into a character?