|
From: Mike M. <mc...@ms...> - 2001-11-29 17:23:06
|
Hello Jeff,
You'll have to put a catch in there to stop the window from closing. What's
happening is the program is opening the dos window, executing, then closing
the dos window when its done. You see a flashing window :)
Include the header file stdlib.h (#include <stdlib.h>) then add, at the
bottom of your program before the return statement the command
"system("pause");" This will hold the window open for you long enough to
see the stuff (till you hit a key)
Mike
>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
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
|