Menu
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY CYBERSECURITY DATA SCIENCE
     ❯   

C string strerror() function

❮ string Functions


Example

Output a variety of error messages:

printf("%s\n", strerror(0));
printf("%s\n", strerror(1));
printf("%s\n", strerror(2));
printf("%s\n", strerror(3));
Try it Yourself »

Definition and Usage

The strerror() function returns a string describing the meaning of an error code.

The strerror() function is defined in the <string.h> header file.


Syntax

strerror(int errcode);

Parameter Values

Parameter Description
errcode Required. An error code.

Technical Details

Returns: A pointer to a string describing the meaning of the error code.

❮ string Functions


Related Pages

C Strings Tutorial

C String Functions Tutorial