The string function strerror is a C / C ++ language function that translates the error code, which is usually stored in the errno global variable , into an error message that people can understand.
Content
History
The strerror function is defined in IEEE Std 1003.1, also known as POSIX 1 .
Returnability
The strerror function is not cost-effective . There are two thread-safe strerror replacements: strerror_s in visual c ++ and strerror_r in the POSIX standard.
Usage
Connection
- C
#include <string.h>
- C ++
#include <cstring>
Announcement
char * strerror ( int errnum );
Semantics
The function generates and displays a C -style string with an error message received from the error code passed to errnum .
See also
- strerror_r
- perror
- ISO / ANSI C
- ISO / ANSI C ++
- Posix
- Unified UNIX Specification