Espaços nominais
Variantes
Acções

errno

Da cppreference.com
< cpp‎ | error

 
 
Biblioteca de utilitários
Digite apoio (basic types, RTTI, type traits)
Gerenciamento de memória dinâmica
De tratamento de erros
Utilidades do programa
Variadic funções
Data e hora
Objetos de função
(C++11)
Os operadores relacionais
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Pares e tuplas
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
Troque, avançar e avançar
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
 
De tratamento de erros
Manipulação de exceção
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.
Manipulação de falhas de exceção
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.
(obsoleta)
(C++11)(obsoleta)
(obsoleta)
Categorias de exceção
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.
Códigos de erro
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.
Códigos de erro
errno
Afirmações
Original:
Assertions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
instalação system_error
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.
(C++11)
(C++11)
 
Definido no cabeçalho <cerrno>
#define errno /*implementation-defined*/
errno é um pré-processador de macro que se expande a uma static(até C++11) / thread-local(desde C++11) modificável lvalue de int tipo. Várias funções de biblioteca padrão indicam erros, por escrito inteiros positivos para errno. Tipicamente, o valor de errno é definido como um dos códigos de erro, como listado na <cerrno> constantes de macros que começam com a letra E, seguido por letras maiúsculas ou dígitos.
Original:
errno is a preprocessor macro that expands to a static(até C++11) / thread-local(desde 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.
O valor da errno é 0 na inicialização do programa e, embora as funções da biblioteca é permitido escrever números inteiros positivos para errno ou não um erro, nunca bibliotecas de funções armazenar 0 em 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.

[editar] Exemplo

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

Saída:

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

[editar] Veja também

macros para condições normais POSIX-compatíveis erro
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.

(macro constante) [edit]
exibe uma seqüência de caracteres correspondente do erro atual para 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.

(função) [edit]
retorna uma versão do texto de um código de erro apresentado
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.

(função) [edit]