Error Handling Functions in C
Error Handling Functions in C
#include <errno.h>
#include <stdio.h>
int main()
{
// If a file is opened which does not exist,
// then it will be an error and corresponding
// errno value will be set
FILE* fp;
return 0;
}
Output
Value of errno: 2
Note: Here the errno is set to 2 which means
“No such file or directory”. It may give Errno 13
in online IDE, which says permission denied