www.delorie.com/djgpp/doc/libc-2.01/libc_504.html   search  
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.

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.

  prev next   webmaster     delorie software   privacy  
  Copyright © 1997     Updated Apr 1997