C loop until keypressed help?

3uPh0riC's Avatar, Join Date: Jun 2008
Newbie Member
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's Avatar, Join Date: Aug 2004
What operating system are you using, and what compiler?
If Windows, is it a Windows application or a console application?
aali's Avatar, Join Date: Jul 2008
Go4Expert Member
I can write the cod by C++




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

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