perror
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. |
| Defined in header <stdio.h>
|
||
| void perror( const char *s ); |
||
Láminas a stderr el contenido de la cadena de caracteres terminada en nulo apuntado por
s (a menos que s es un puntero nulo), seguido de los dos caracteres ": ", seguido de la aplicación definida mensaje de error que describe el código de error almacenado actualmente en la variable de sistema errno (idéntica a la salida de strerror(errno)), seguido por '\n' .Original:
Prints to stderr the contents of the null-terminated character string pointed to by
s (unless s is a null pointer), followed by the two characters ": ", followed by the implementation-defined error message describing the error code currently stored in the system variable errno (identical to the output of strerror(errno)), followed by '\n'.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.
Contenido |
[editar] Parámetros
| s | - | puntero a una cadena terminada en nulo con mensaje explicativo
Original: pointer to a null-terminated string with explanatory message 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
(Ninguno)
Original:
(none)
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.
[editar] Ejemplo
#include <fcntl.h> #include <stdio.h> int main() { if (open("non_existent", O_RDONLY) == -1) { perror("open()"); } }
Output:
open(): No such file or directory
[editar] Ver también
| devuelve una versión de texto de un código de error 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. (función) | |
| C++ documentation for perror
| |