Or better:
#include <stdlib.h>
system("pause");
Or the best solution that i do, open a permanent console window.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Daniel Glenfield
> Sent: Sunday, April 07, 2002 1:00 PM
> To: jpa...@ya...; dev...@li...
> Subject: Re: [Dev-C++] DOS Window
>
>
> Yes DEV closes as soon as the program has finished. What I do
> to stop this
> is to
> 1) at the start of the code type #include <iostream.h> (I
> know it's not the
> 'proper' way but it will work fine here
> 2) before the end of the program type
> int x;
> cin >> x;
>
> and the program will wait for you to type a number before
> exiting. You may
> like to add cout << "Please type a number to exit\n"; on the
> line above the
> cin statement for other ppl to know how to exit.
>
> Daniel
|