getch(). When I press two key at the same time, error...

I'm program on a game which need to move something, I learnt that getch() function can solve a moving problem, it works!\
But the problem comes too, when I accidentally press two key at the same time, the program keep reading that keyword and ignore my following input...
I wanna know how to solve such a problem , thanks!

HEAP CORRUPTION DETECTED: before normal block #153 at 0x004C8EF0
CRT detected that the application wrote the memory before start of heap buffer.
The console stream was not designed for this kind of input. What you should be using is something like "GetAsyncKeyState()" from the WinAPI: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646293(v=vs.85).aspx and running it against all of the meaningful keys in you input loop. Even that isn't ideal though, it's just good enough for most cases. There is a reason that there are so many libraries designed specifically for making games.
Topic archived. No new replies allowed.