file-handling · intermediate · ~15 min
fread a fixed-size record.
Implement int read_int_binary(const char *path, int *out) reading a single int (native layout) from the start of the file into *out. Return 0 on success, -1 on any failure.
#include <stdio.h>
int read_int_binary(const char *path, int *out) {
/* TODO */
return -1;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.