strerror
raw OCR
Returns a pointer to an error message string.
Defined in header <string.h>
Syntax
#include <string.h>
char *strerror(int errmim);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ | ■ |
Remarks
strerror takes an int parameter errmim, an error number, and returns a pointer to an error message string associated with errmim.
Return value
strerror returns a pointer to a constructed error string. The error message string is constructed in a static buffer that is overwritten with each call to strerror.
See also
Example
#include <stdio.h>
#include <errno.h>
int main (void)
{
char *buffer;
buffer = strerror (errno);
printf ("Error: %s\n", buffer);
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/string.h/strerror/
· short form /3.1/strerror/