void perror ( const char * str );
1
2
3
4
5
6
7
8
9
10
11
12
13
/* perror example */
#include <stdio.h>
int main ()
{
FILE * pFile;
pFile=fopen ("unexist.ent","rb");
if (pFile==NULL)
perror ("The following error occurred");
else
fclose (pFile);
return 0;
}
The following error occurred: No such file or directory