Espaces de noms
Variantes
Affichages
Actions

errno

De cppreference.com
< cpp‎ | error

 
 
 
Erreur de manipulation
La gestion des exceptions
Original:
Exception handling
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
exception
uncaught_exception
exception_ptr (C++11)
make_exception_ptr (C++11)
current_exception (C++11)
rethrow_exception (C++11)
nested_exception (C++11)
throw_with_nested (C++11)
rethrow_if_nested (C++11)
Défaillances de gestion des exceptions
Original:
Exception handling failures
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
terminate
terminate_handler
get_terminate (C++11)
set_terminate
unexpected (obsolète)
bad_exception
unexpected_handler (obsolète)
get_unexpected (C++11) (obsolète)
set_unexpected (obsolète)
Catégories d'exception
Original:
Exception categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
logic_error
invalid_argument
domain_error
length_error
out_of_range
runtime_error
range_error
overflow_error
underflow_error
Les codes d'erreur
Original:
Error codes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Les codes d'erreur
errno
Les assertions
Original:
Assertions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
assert
system_error installation
Original:
system_error facility
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
error_category (C++11)
generic_category (C++11)
system_category (C++11)
error_condition (C++11)
errc (C++11)
error_code (C++11)
system_error (C++11)
 
Defined in header <cerrno>
#define errno /*implementation-defined*/
errno est une macro du préprocesseur qui se dilate à une static (avant C++11) / thread-local (depuis C++11) modifiables lvalue de int type. Plusieurs fonctions de bibliothèque standard indiquent des erreurs en écrivant des entiers positifs à errno. En règle générale, la valeur de errno est réglé sur l'un des codes d'erreur, énumérés à l'<cerrno> comme des constantes macro qui commencent par la lettre E, suivie par des lettres majuscules ou chiffres .
Original:
errno is a preprocessor macro that expands to a static (avant C++11) / thread-local (depuis C++11) modifiable lvalue of type int. Several standard library functions indicate errors by writing positive integers to errno. Typically, the value of errno is set to one of the error codes, listed in <cerrno> as macro constants that begin with the letter E, followed by uppercase letters or digits.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
La valeur de errno est 0 au démarrage du programme, et bien que les fonctions de bibliothèque sont autorisés à écrire des nombres entiers positifs à errno si oui ou non une erreur s'est produite, fonctions de bibliothèque ne jamais stocker 0 dans errno .
Original:
The value of errno is 0 at program startup, and although library functions are allowed to write positive integers to errno whether or not an error occurred, library functions never store 0 in errno.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Exemple

[edit]
#include <iostream>
#include <cmath>
#include <cerrno>
#include <cstring>
 
int main()
{
    double not_a_number = std::log(-1.0);
    if (errno == EDOM) {
        std::cout << "log(-1) failed: " << std::strerror(errno) << '\n';
    }
}

Résultat :

log(-1) failed: Numerical argument out of domain

[modifier] Voir aussi

macros pour des conditions standard d'erreur compatible POSIX
Original:
macros for standard POSIX-compatible error conditions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(constante macro) [edit]
affiche une chaîne de caractères correspondant de l'erreur de courant à stderr
Original:
displays a character string corresponding of the current error to stderr
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction) [edit]
renvoie une version texte d'un code d'erreur indiqué
Original:
returns a text version of a given error code
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction) [edit]