It is probably your IDE that is prompting for you to press any key, C++ programs don't automatically ask you to press any key when they finish executing.
escape()
{
cout<<"\n\n\n\n Thank You For Using Master Aryhan's Work!";
timer();
system ("cls");
atexit (0);
return 0;
}
here is my code.. when 'e' is press it will direct you to function escape()
what i like is when the atexit() or exit () runs.. it will no longer display "Press any key to continue" to close the console.
IDE stands for "Integrated Development Environment." For example, Eclipse, Netbeans, Visual C++ etc. are all IDE's. If you don't write your program using a regular text editing program and compile it from a terminal, the program you are using to write and compile your programs is an IDE.
I'm pretty sure there is an option in VC++6.0 to turn off the "Press any key..." behavior.
It shouldn't be an issue, because the only time you will see that is when you run your program from inside the IDE/editor.
The atexit() function registers a close-down function. You don't need it.
You also don't need to be clearing the screen before your program terminates.
1 2 3 4 5 6
void escape()
{
cout<<"\n\n\n\n Thank You For Using Master Aryhan's Work!" << flush;
timer();
exit(0); /* <-- this terminates your program */
}
That is correct. I usually test my programs from the console anyway... but you can also test them by using Windows Explorer to find your program's EXE and double-clicking it.