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 - perror http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   perror

   Usage
   #include <stdlib.h>
   void perror(char *msg);

   Description
   Displays  a message on the standard output describing the  last  error
   that occurred in a system call or library function call. The  argument
   msgis printed first, then a colon, followed by the error description.

   Example
   #include <stdio.h>
   #include <stdlib.h>
   main()
   {
   FILE *fp;
   char *string = "Error message";

        if((fp = fopen("fild.dat","r")) == NULL)
             perror(string);
        else
             printf("File open for reading\n");

        fclose(fp);
   }


See Also: strerror

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