print, in stderr, the message associated with the value of errno
#include <stdio.h> void perror( const char *prefix );
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.
See the section “Messages Generated by the perror() Function” in Appendix A: Implementation-defined Behavior for more information.
Nothing
#include <stdio.h> void main() { FILE *fp; fp = fopen( "data.fil", "r" ); if( fp == NULL ) { perror( "Unable to open file" ); } }
ANSI
All (except DOS/PM)