
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>strerror</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
strerror
Usage
#include <string.h>
char *strerror(int errornum);
ANSI
Description
Maps errornum to an error message string and returns a pointer to that
string.
Example
#include <stdio.h>
#include <errno.h>
#include <io.h>
#include <dos.h>
#include <string.h>
#include <stdlib.h>
int main()
{
int fp;
errno = 0;
if((fp = open("file",O_RDONLY)) == -1)
{
printf(strerror(errno));
}
close(fp);
return EXIT_SUCCESS;
}
Return Value
strerror returns a pointer to the error message string.
See Also
perror
See Also: perror
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson