perror()

This displays an error message indicating the error that might have occurred while invoking a function or system call. The error message is displayed to stderr, that is, the standard error output stream. This is basically the console. 

Here is its syntax:

void perror ( const char * str );

The error message that is displayed is optionally preceded by the message that's represented by str.