...
Code Block | ||||
---|---|---|---|---|
| ||||
errno = 0;
FILE* fd = fopen( filename, "r");
if (fd == NULL) {
char* errmsg = strerror(errno);
printf("Could not open file because of %s\n", errmsg);
}
|
...
Code Block | ||||
---|---|---|---|---|
| ||||
errno = 0;
FILE* fd = fopen( filename, "r");
if (fd == NULL) {
char errmsg[BUFSIZ];
if (strerror_r(errno, errmsg, BUFSIZ) != 0) {
/* handle error */
}
printf("Could not open file because of %s\n", errmsg);
} |
...