How to get console's close message?
-
i create a console project, i want to get console's close message when i close console programe.
-
Closing the console window will just kill the process. So, AFAIK, your program won't be able to react on that event. What you can intercept is the "CTRL+C" event. On Windows you need to install a "ConsoleCtrlHandler":http://goo.gl/UQrYcG function. On Linux you need to install a "signal handler":http://www.gnu.org/software/libc/manual/html_node/Signal-Handling.html for the SIGINT signal.
-
waht about to ues atexit?