function
<cstring>
strerrorchar * strerror ( int errnum );
Get pointer to error message string
Interprets the value of errnum, generating a string with a message that describes the error condition as if set to errno by a function of the library.The returned pointer points to a statically allocated string, which shall not be modified by the program. Further calls to this function may overwrite its content (particular library implementations are not required to avoid data races).
The error strings produced by strerror may be specific to each system and library implementation.
1
2
3
4
5
6
7
8
9
10
11
12
13
/* strerror example : error list */
#include <stdio.h>
#include <string.h>
#include <errno.h>
int main ()
{
FILE * pFile;
pFile = fopen ("unexist.ent","r");
if (pFile == NULL)
printf ("Error opening file unexist.ent: %s\n",strerror(errno));
return 0;
}
Error opening file unexist.ent: No such file or directory
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4