Integer type (typically 4 bytes, -2,147,483,648 to 2,147,483,647)
1st Parameter
The error number corresponding to the system error message to be retrieved.
Read more about parameters of strerror in parameters section
The strerrorfunction in C language Returns a pointer to the textual representation of the current errno value.
The strerror function returns a pointer to a string that describes the error code passed in the argument errnum. The error strings returned by strerror depend on the developing platform and compiler. The returned string must not be modified by the program, but may be overwritten by a subsequent call to strerror.
The strerrorfunction takes 1
parameter:
•
int `errnum`: The error number corresponding to the system error message to be retrieved.
Returns a pointer to a string describing the error code specified by `errnum`. The returned string is statically allocated and should not be modified or freed. This function translates system error numbers to human-readable messages.
The strerror function return value :
Returns a pointer to the error string describing error errnum
Output
This example demonstrates basic usage of strerror to get a description of an error when trying to open a non-existent file.