#include <stdio.h> void perror(const char *string);
This function formats an error message and prints it to stderr
.
The message is the string, a colon, and a message suitable for the error
condition indicated by errno
.
None.
ANSI, POSIX
int x = open("foo", O_RDONLY); if (x < 0) { perror("foo"); exit(1); }
Go to the first, previous, next, last section, table of contents.