C perror()

« Previous Function Next Function »


The perror() function maps the value of global variable errno onto a string and writes that string to the stderr. If value of str is not null, string is written first, followed by a colon and then the implementation-defined error message.

perror() Syntax

void perror(const char *str);

perror() Example

Following c code reports any I/O error that may have occurred on the stream associated with fp :

	perror("File error ");

« Previous Function Next Function »