Question about the spacebar
How is the spacebar character represented in C++. What I mean is, if i wanted to use the getch() function and say that
getch()=''spacebar'' what would I write. Would I write the word spacebar or is there something else I need to write.
-Any help would be most appreciated
BioagentX
Just use ' ' I think.
EDIT: there is a space between ' and ', but it dissappears...
-~-The Cow of Darkness-~-
[edited by - cowsarenotevil on March 30, 2003 9:50:06 PM]
EDIT: there is a space between ' and ', but it dissappears...
-~-The Cow of Darkness-~-
[edited by - cowsarenotevil on March 30, 2003 9:50:06 PM]
spacebar ascii code: 0x20 or 32 decimal :-)
char key = getch();
if( key == 32 ) // test for space
or you could just use '' '' :-)..
char key = getch();
if( key == 32 ) // test for space
or you could just use '' '' :-)..
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement