file-handling · intermediate · ~15 min

Load a record

Deserialise a fixed record in the same field order.

Challenge

Implement int load_record(const char *path, int *id, int *score) reading the two ints written by save_record. Return 0 on success, -1 on failure.

Starter code

#include <stdio.h>

int load_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.