Go to the first, previous, next, last section, table of contents.


perror

Syntax

#include <stdio.h>

void perror(const char *string);

Description

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.

Return Value

None.

Portability

ANSI, POSIX

Example

int x = open("foo", O_RDONLY);
if (x < 0)
{
  perror("foo");
  exit(1);
}


Go to the first, previous, next, last section, table of contents.