goto statement ??? Need help

This is program which i need help.
#include<iostream.h>
void main()
{
int c=0;
jump:c=c+1;
cout<<c<<endl;
goto jump;
}

OK When statement(goto jump) is encountered the program returns to label statement to execute the program second time and so on it never stop until ctrl+break is pressed.
i want that if programs starts and i specify a letter from keyboard and when i press that letter or word the programs stop. without press ctrl+break.????
http://cplusplus.com/doc/tutorial/

Check out the section on control structures. The while loop should interest you.
closed account (z05DSL3A)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <iso646.h> 

int main()
{
    bool finished = false;
    while( not finished)
    {
        // do stuff...

        std::cout << " Do you want to finish? ";
        char in = '\0';
        std::cin >> in;
        if( in == 'y')
            finished = true;
    }
    return 0;
}
thknxxx bro>>>> prb is solved>>>aaaahh
Topic archived. No new replies allowed.