Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - strerror http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   strerror

   Usage
   #include <string.h>
   char *strerror(int errornum);

   Description
   This function is NOT part of String_package.
   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>

   main()
   {
   int fp;

        errno = 0;
        if((fp = open("file",O_RDONLY)) == -1)
        {
             printf(strerror(errno));
        }
        close(fp);
   }

   Return Value
   strerror returns a pointer to the error message string.


See Also: perror

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson