|
2 answers
After completion of the last action, exit from the program will occur by itself. For example:
#include <iostream> using namespace std; int main () { cout << "Hello, World" << endl; return 0; } The last action is the return command return. After this, auto exit occurs. If any arbitrary action was meant, you can exit using the exit function from stdlib
# include <stdlib.h> // ... последнее действие exit(0); You can also exit by throwing an unhandled exception, which will cause an emergency stop.
throw; - 2In the case of GUI applications, you may have to use other calls. For example, <a href= doc.qt.nokia.com/latest/…> for the Qt toolkit. It is possible to send a WM_QUIT or SIGTERM message. Or something similar. - gecube
|
From int main() ? return 0 . In fact, it will come out after the last action. "Teach materiel"
|