C++ cstring strerror() function
Example
Output a variety of error messages:
cout << strerror(0) << "\n";
cout << strerror(1) << "\n";
cout << strerror(2) << "\n";
cout << strerror(3) << "\n";
Try it Yourself »
Definition and Usage
The strerror() function returns a C-style string describing the meaning of an error code.
The strerror() function is defined in the <cstring> header file.
Syntax
strerror(int errcode);
Parameter Values
| Parameter | Description |
|---|---|
| errcode | Required. An error code. |
Technical Details
| Returns: | A pointer to a C-style string describing the meaning of the error code. |
|---|