Quote:
Originally posted by Ian W.
ok thanks. only one more problem then. how can i moniter the keyboard without stopping every loop cycle? i know about cin and fin (fstream). that's all. both stop until data is put in and the 'enter' key is hit. that wouldn't do. there must be some way around this, anyone know how? cause if that works, then the program will actually work better than i expected
|
I haven't tried this with C++, but in C you use kbhit(). It's possible this might work in C++ too, but it's risky.
Check out
in_avail. That may do what you want. I believe if you call cin.in_avail() it will return > 0 if a key has been struck. You can simply avoid doing the keyboard read if there's nothing to read.