atexit
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody>| Déclaré dans l'en-tête <stdlib.h>
|
||
int atexit( void (*func)() ); |
||
Enregistre la fonction pointée par
func d'être appelé à la cessation normale du programme (via exit() ou au retour d'main()) .Original:
Registers the function pointed to by
func to be called on normal program termination (via exit() or returning from main()).The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Appel de la fonction de plusieurs threads n'induit pas une race de données. La mise en œuvre doit appuyer l'homologation des fonctions
32 au moins .Original:
Calling the function from several threads does not induce a data race. The implementation shall support the registration of at least
32 functions.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Paramètres
| func | - | pointeur vers une fonction qui sera appelée à la fin du programme normal
Original: pointer to a function to be called on normal program termination The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Retourne la valeur
0 si l'inscription réussit, valeur différente de zéro autrement .Original:
0 if the registration succeeds, nonzero value otherwise.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Exceptions
Exemple
#include <stdlib.h>
#include <stdio.h>
void f1()
{
puts("pushed first");
}
void f2()
{
puts("pushed second");
}
int main()
{
atexit(f1);
atexit(f2);
}
Résultat :
pushed second
pushed first
Voir aussi
(C99) |
enregistre une fonction qui sera appelée lors de son invocation quick_exit Original: registers a function to be called on quick_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) |
C++ documentation for atexit
|