C loop until keypressed help?

Newbie Member
25Jun2008,19:40   #1
3uPh0riC's Avatar
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
Mentor
16Jul2008,16:19   #2
xpi0t0s's Avatar
What operating system are you using, and what compiler?
If Windows, is it a Windows application or a console application?
Go4Expert Member
22Jul2008,13:49   #3
aali's Avatar
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