Namensräume
Varianten
Aktionen

errno

Aus cppreference.com
< cpp‎ | error

 
 
 
Fehlerbehandlung
Exception Handling
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)
Ausnahmebehandlung Ausfälle
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(veraltet)
bad_exception
unexpected_handler(veraltet)
get_unexpected(C++11)(veraltet)
set_unexpected(veraltet)
Exception Kategorien
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
Fehlercodes
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.
Fehlercodes
errno
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 Anlage
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)
 
definiert in Header <cerrno>
#define errno /*implementation-defined*/
errno ist ein Präprozessor-Makro, die zu einer static(bis C + +11) / thread-local(seit C++11) modifizierbaren lvalue vom Typ int erweitert. Mehrere Standard-Library-Funktionen zeigen Fehler, indem er positive Ganzzahlen errno. Typischerweise wird der Wert errno einer der Fehlercodes in <cerrno> als Makro-Konstanten, die mit dem Buchstaben E beginnen, gefolgt von Großbuchstaben oder Ziffern aufgeführten Projekte gesetzt .
Original:
errno is a preprocessor macro that expands to a static(bis C + +11) / thread-local(seit 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.
Der Wert der errno ist 0 beim Programmstart, und obwohl Bibliotheksfunktionen dürfen positive Ganzzahlen errno schreiben, ob ein Fehler aufgetreten ist, Bibliotheks-Funktionen speichern niemals 0 in 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.

[Bearbeiten] Beispiel

[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';
    }
}

Output:

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

[Bearbeiten] Siehe auch

Makros für Standard-POSIX-kompatiblen Fehlerbedingungen
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.

(Makro konstant) [edit]
zeigt eine Zeichenfolge entspricht der aktuellen Fehler 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.

(Funktion) [edit]
gibt einen Text-Version eines bestimmten Fehlercode
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.

(Funktion) [edit]