Espaços nominais
Variantes
Acções

std::strerror

Da cppreference.com
< cpp‎ | string‎ | byte

 
 
Biblioteca cordas
Strings terminadas
Original:
Null-terminated strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Cadeias de bytes
Multibyte cordas
Cordas de largura
Classes
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Cordas de terminação nula de bytes
Funções
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Manipulação personagem
Original:
Character manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Conversões para formatos numéricos
Original:
Conversions to numeric formats
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 cadeia
Original:
String manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Exame String
Original:
String examination
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 memória
Original:
Memory manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Diversos
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
strerror
 
Definido no cabeçalho <cstring>
char* strerror( int errnum );
Retorna a versão texto do código de erro errnum. errnum é geralmente adquirida a partir da variável errno, no entanto a função aceita qualquer valor de int tipo. A mensagem é específica para cada caso.
Original:
Returns text version of the error code errnum. errnum is usually acquired from the errno variable, however the function accepts any value of type int. The message is locale-specific.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
A seqüência de byte retornado não deve ser modificado pelo programa, mas pode ser substituído por uma chamada subseqüente para a função strerror.
Original:
The returned byte string must not be modified by the program, but may be overwritten by a subsequent call to the strerror function.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Índice

[editar] Parâmetros

errnum -
valor. integrante referindo-se a um erro de código
Original:
integral value referring to a error code
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

Pointer. a um byte string terminada em nulo correspondente ao código de erro errnum.
Original:
Pointer to a null-terminated byte string corresponding to the error code errnum.
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]
Documentação C para strerror