Espaces de noms
Variantes
Affichages
Actions

std::exit

De cppreference.com
< cpp‎ | utility‎ | program
 
 
 
Services d'appui aux programmes
La fin du programme
Original:
Program termination
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
abort
exit
quick_exit (C++11)
_Exit (C++11)
Communiquer avec l'environnement
Original:
Communicating with the environment
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Signaux
Original:
Signals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Types de signaux
Original:
Signal types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
SIGABRT
SIGFPE
SIGILL
SIGINT
SIGSEGV
SIGTERM
Non-locales sauts
Original:
Non-local jumps
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
setjmp
longjmp
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
jmp_buf
 
Déclaré dans l'en-tête <cstdlib>
[[noreturn]] void exit( int exit_code );
(depuis C++11)
             void exit( int exit_code );
(avant C++11)

Provoque un arrêt normal du programme.

Plusieurs étapes de nettoyage ont lieu:

  • appelle le destructeur des objets ayant une durée de stockage locale au thread
  • appelle le destructeur des objets ayant une durée de stockage statique
  • les fonctions fournies à std::atexit sont appelées. Si une exception tente de se propager depuis la fonction, std::terminate est appelée
  • tous les flux de type C sont vidés et fermés
  • les fichiers créés par std::tmpfile sont supprimés
  • le contrôle est renvoyé à l'environnement hôte. Si exit_code est EXIT_SUCCESS, une valeur de retour défini par l'implémentation et indiquant une fin réussie est retournée. Si exit_code est EXIT_FAILURE, une valeur de retour défini par l'implémentation, et indiquant une fin en échec est retournée. Autrement, une valeur de retour défini par l'implémentation est retournée.

Les destructeurs de variables avec la durée de stockage automatique ne sont pas appelés .

Sommaire

[modifier] Paramètres

exit_code - valeur de retour du programme

[modifier] Retourne la valeur

(Aucun)

[modifier] Exemple

[modifier] Voir aussi

provoque la terminaison anormale du programme (sans nettoyage)
Original:
causes abnormal program termination (without cleaning up)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction) [edit]
enregistre une fonction qui sera appelée lors de son invocation exit()
Original:
registers a function to be called on exit() invocation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction) [edit]
(C++11)
provoque l'arrêt du programme normal sans complètement nettoyer
Original:
causes normal program termination without completely cleaning up
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction) [edit]