![]() |
![]() |
![]() |
C++ Reference: strerror()
strerror()
Declaration
char* strerror(int iErrorNumber);
Description
This function returns a pointer to a string containing the error message corresponding to the error number given by "iErrorNumber."
Example
#include <cstdio>
#include <cstring>
int main()
{
// Output the first 10 error messages
for (int iIndex = 0; iIndex < 10; ++iIndex) {
char* cpErrorMsg = strerror(iIndex);
printf("Error number %i is %s\n", iIndex, cpErrorMsg);
}
return 0;
}
Output:
![]() |
![]() |
![]() |
| Home | | | Reference | | | Play Games! | | | Blog | | | Forum | | | Site Map | | | Contact Us |





