totn C Functions

C Language: strerror function
(Convert Error Number to String)

In the C Programming Language, the strerror function returns a pointer to a string that contains an error message for a given errnum.

Syntax

The syntax for the strerror function in the C Language is:

char *strerror(int errnum);

Parameters or Arguments

errnum
An error number that you want to retrieve the error message for.

Returns

The strerror function returns a pointer to a string that contains an error message for a particular errnum.

Required Header

In the C Language, the required header for the strerror function is:

#include <string.h>

Applies To

In the C Language, the strerror function can be used in the following versions:

  • ANSI/ISO 9899-1990

Similar Functions

Other C functions that are similar to the strerror function: