file-handling · intermediate · ~15 min
Serialise a small fixed record to disk.
Implement int save_record(const char *path, int id, int score) writing the two ints (id then score, native layout) to path. Return 0 on success, -1 on failure.
#include <stdio.h>
int save_record(const char *path, int id, int score) {
/* TODO */
return -1;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.