Skip to main content

Deposit Log Audit

Challenge on lesson: Checkpoint: File I/O

Implement int log_deposit(const char *path, int cents) appending a line "D <cents>\n" (mode "a"), and int audit_total(const char *path) reading all "D <int>" lines and returning the sum (other lines are ignored; missing file returns -1).

Difficulty: beginner

Back to lesson: Checkpoint: File I/O