Key detection

Hello, so I'm trying to figure out how to detect if a key is pressed, such as the 'Y' key. I asked a friend and he mentioned using constant unsigned chars such as
const unsigned char Y;
and then have it equal a number, but I'm not sure if the number matters? Also, once I've done this, how does this help me detect if the 'Y' key has been pressed?

Does anyone have any advice?
It depends on the operating system. What operating system are you using?
Windows :)
End of this thread might be what you're after: http://www.cplusplus.com/forum/beginner/3523/
Thanks!
Topic archived. No new replies allowed.