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/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdio.h>
    void perror( const char *prefix );

Description:
    The  perror function prints, on the file designated by  stderr, the
    error message corresponding to the error number contained in  errno.
     The  perror function writes first the string pointed to by prefix to
    stderr.  This is followed by a colon (":"), a space, the string returned
    by strerror(errno), and a newline character.

Returns:
    The  perror function returns no value.  Because the function uses the
     fprintf function,  errno can be set when an error is detected during
    the execution of that function.

See Also:
    strerror

Example:
    #include <stdio.h>

    void main()
      {
        FILE *fp;

        fp = fopen( "data.fil", "r" );
        if( fp == NULL ) {
            perror( "Unable to open file" );
        }
      }

Classification:
    ANSI

Systems:
    All

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