Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   C loop until keypressed help? (http://www.go4expert.com/forums/c-loop-keypressed-help-t11626/)

3uPh0riC 25Jun2008 19:40

C loop until keypressed help?
 
Hi i need help in C please. I need to run a loop until i press a key, any key doesnt matter. The loop needs to execute until i decide to press a key, not wait each cycle for me to press a key. If someone can help id appreciate thanx

xpi0t0s 16Jul2008 16:19

Re: C loop until keypressed help?
 
What operating system are you using, and what compiler?
If Windows, is it a Windows application or a console application?

aali 22Jul2008 13:49

Re: C loop until keypressed help?
 
I can write the cod by C++

take
...

..
..
while(!cin.eof())
{

..
...
...

..
int n;
cout<<"Please Enter a value or EOF to stop"<<endl;
cin>>n;

}
//EOF in visual c++ ctrl+Z
//EOF in Linux c++ ctrl+d


All times are GMT +5.5. The time now is 07:21.