Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <string.h>
    char *strerror( int errnum );
    wchar_t *wcserror( int errnum );

Description:
    The strerror function maps the error number contained in errnum to an
    error message.

    The wcserror function is identical to strerror except that the message
    it points to is a wide-character string.

Returns:
    The strerror function returns a pointer to the error message.  The array
    containing the error string should not be modified by the program.  This
    array may be overwritten by a subsequent call to the strerror function.

Example:
    #include <stdio.h>
    #include <string.h>
    #include <errno.h>

    void main()
      {
        FILE *fp;

        fp = fopen( "file.nam", "r" );
        if( fp == NULL ) {
            printf( "Unable to open file: %s\n",
                     strerror( errno ) );
        }
      }

Classification:
    strerror is ANSI, wcserror is ANSI

Systems:
     strerror - All, Netware

    wcserror - DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32

See Also:
    clearerr, feof, ferror, perror

See Also: clearerr feof

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