Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Termination Upon Esc

Name: Anonymous 2008-04-15 21:30

#include "iostream"
#include "conio.h"
using namespace std;
void main ()
{
    signed int a=0;
    do
    {
        a++;
        cout<<a<<endl;

    }
    while (a>-1);
    getch();
}

I want this loop program to terminate upon pressing esc key. How do I do that /prog/? Halp me pls.

Name: Anonymous 2008-04-16 1:40

>>11
FFS, just because it's NP complete doesn't mean it's impossible. It will only be pratcial for small cases (< size 50), but OP's program seems simple enough, so it should work.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List