C Tutorial/stdio.h/perror
perror
Item Value Header file stdio.h Declaration void perror(const char *str); Function maps error message to the global variable errno and outputs that string to stderr.
<source lang="cpp">#include <stdio.h>
#include <stdlib.h> int main(void) { perror("File error "); }</source>