nationnon
asked on
keeping the info up with a function
I'm have a little problem keeping my output to stay up when it calculates the answer. It doesn't ask you to hit a key to exit or nothing. It just shuts off. It works fine when I execute in visual c++ but when I send the program out with it's own exe it doesn't. Can't I create a function that will cut it off in 5 seconds? Or atleast ask the user to hit a key to continue?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if it is console mode, then run it from a command prompt window.
Alterntaively, make it into a simple dialog (or SDI app with edit view) and have it write to a multi-line edit box that the user can scroll through to view the results and then close when they've seen enough.
Alterntaively, make it into a simple dialog (or SDI app with edit view) and have it write to a multi-line edit box that the user can scroll through to view the results and then close when they've seen enough.
Is your application a Win32 console? If so then you can use
#include <iostream.h>
#include <conio.h>
....
char c;
cout.flush();
cout << "Press any key to continue...";
c = getch(); // waits here
....
to wait until user's response.
Andrew.