I use;
#include "stdafx.h"
#include %26lt;iostream%26gt;
using namespace std;
int main(void)
{
cout %26lt;%26lt; "Hello World";
printf("Press any key to disappear this program\n");
getchar();
return 0;
}
And it just flashes and disappears?
When using Visual C++ the program flashes and goes away, even thought I use code to keep it open?
Try this:
while(!getchar())
{
//pause the thread
this.sleep(5000);
}
in place of getchar();
make sure getchar() is a boolean function that returns true if char is there or false otherwise
Reply:try getch() instead of getchar()
It's in the conio.h librabry.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment