file-handling · beginner · ~15 min
Open a file and check the result of fopen.
Implement int file_readable(const char *path) returning 1 if the file can be opened for reading (and closing it again), else 0.
#include <stdio.h>
int file_readable(const char *path) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.