C Programming • C17 baseline, standards-specific features labeled
Capstone: A Defensive Command-Line Record Tool
Bring together input parsing, structures, arrays, files, and tests in one small C program.
Build a command-line utility that reads one record per line, validates each field, stores a bounded number of records, and writes a summary file. Keep parsing, validation, storage, and output in separate functions so each part can be tested independently.
Example
struct record {
unsigned id;
char label[32];
int active;
};
/* Define separate functions for parsing, validation, and writing records. */
What to expect
A complete solution should reject malformed rows, report file errors, and never write beyond the record capacity.
Key idea: A useful C project demonstrates ownership, bounds, error paths, and tests—not only a successful example run.