#include <stdio.h>
#include <stdlib.h>
int main() {
const char* filename = "d:\\example.txt";
FILE* fp = fopen(filename, "r");
if (fp == NULL) {
fprintf(stderr, "Error open file");
printf(", errno = %d", errno); // 2 = no file name with this name
exit(1);
}
return 0;
}
/*
run
Error open file, errno = 2
*/