GDN:perror

From LibrePlanet
Revision as of 16:29, 19 December 2013 by Dgumberg (talk | contribs) (Created page with "{{Infobox Function | header = stdio.h }} The function <code>perror</code> prints an error message to the stream <code>stderr</code>. The orientation of <code>stderr</code>...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


The function perror prints an error message to the stream stderr. The orientation of stderr is not changed.

If you call perror with a message that is either a null pointer or an empty string, perror just prints the error message corresponding to errno, adding a trailing newline.

If you supply a non-null message argument, then perror prefixes its output with this string. It adds a colon and a space character to seperate the message from the error string correspond to errno.

Contents

Prototype

<source lang="c">void perror (const char *message)</source>

GDN:perror
Header stdio.h