...
else if(wParam == VK_BACK)
{
string getName = Game->getCurrentName();
Game->setCurrentName(getName);
/* Need something like
getName--;
or
getName[getName.size() - 1] = ''/0'';
*/
return 0;
}
I''m on the right lines somewhere I think but I just can''t figure out the syntax. I haven''t used string very much. Can anyone help?
Thanks for reading,
Jaggy.
handling backspace with string
Hey there!
My game is almost finished, but I''ve hit a problem while asking the user to add their name to the highscore table. I can get input, but I don''t know how to handle backspaces.
I''m using WM_CHAR and I have so far:
How about:
getName = getName.left(getname.size() - 1);
I''m not sure if left is the function name but there should be something similar in whichever string class you are using.
getName = getName.left(getname.size() - 1);
I''m not sure if left is the function name but there should be something similar in whichever string class you are using.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement