|
From: Jason H. <jas...@bt...> - 2001-11-29 22:57:22
|
If you add #include <cstdlib> at the top and the line: system("PAUSE"); just
before the return 0; then before the program finishes a message saying Press
Any Key To Continue will pop up and wait for you.
i.e.
#include <cstdlib>
#include <iostream>
int main()
{
cout << "Hello World!" << endl;
system("PAUSE");
return 0;
}
Jason.
----- Original Message -----
From: "Jeff Clark" <ja...@sp...>
To: "Dev-C++ mailing list" <dev...@li...>
Sent: Thursday, November 29, 2001 3:42 PM
Subject: [Dev-C++] Run Problem
> Hello,
>
> I'm new to C++ development; in fact I'm trying to learn by "Sams Teach
> Yourself C++".
>
> I have installed Dev-C++, and have written a test program, the program
> compiles, but when running it, it only flashes quickly on the screen.
>
> My system is a Pentium III with Windows 2000 installed, the program is
> stated below, as it is in the book:
>
>
>
> #include <iostream.h>
>
> int main()
> {
> int x = 5;
> int y = 7;
> cout << "\n";
> cout << x + y << " " << x * y;
> cout << "\n";
> return 0;
> }
>
> ????? What am I doing wrong that the program when executed does not stay
up
> on the screen????
>
>
> Sincerely,
>
> Jeff
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|