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?
|
Results 1 to 2 of 2
Thread: string to charThreaded View
|
Click Here to Expand Forum to Full Width |