All modules Download notes (.txt) Warm-upCoreStretchTry these in the playground →
Advanced -- Module 05
Structures & File Handling
struct and typedef, nested structures, arrays of structs, and file I/O with fopen/fread/fwrite/fprintf for building programs whose data outlives a single run.
Video lesson
Downloadable notes
Plain-text lecture notes for Structures & File Handling.
Practice problems
Student record CRUD
Define a Student struct and support add/list/delete operations over an array of structs.
CSV to struct array
Read a CSV file line by line with fgets, parse each row into a struct, and print a formatted table.
Binary record store
Write an array of structs to a binary file with fwrite, then read it back with fread and verify a checksum.
Module quiz
1. Which keyword lets you create an alias for a struct type?
2. fopen(path, "a") opens a file for:
3. To access a member through a struct pointer p, you use:
4. Forgetting fclose() on a written file risks: