Is there a way to check for imput with out pausing and promting for imput? if i use:
cin >> somecharacter;
it pauses everything and waits till you give a character. How can i ask for imput and keep my program going.
thanks.
Is there a way to check for imput with out pausing and promting for imput? if i use:
cin >> somecharacter;
it pauses everything and waits till you give a character. How can i ask for imput and keep my program going.
thanks.
c++->visualc++->directx->opengl->c++;
(it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)
Code:int main() { char Input=0; while(Input!=27) //Loop while ESC is not pressed. { Input=0; if(kbhit()) Input=getch(); //Store the pressed key (if a key is pressed) //Your code } }
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
For that code to work, don't forget to #include <conio.h>
Allegro precompiled Installer for Dev-C++, MSVC, and Borland: http://galileo.spaceports.com/~springs/