Module 12 · Structures, Unions and Enums
Arrays of Structs, and Structs in Functions
Free with an accountReading
Amara teaches a class, and every student has a name and three marks. Lesson 1 gave her a struct for one student. Now she wants the whole class on the notice board, highest total first.
Sign in to read
This lesson is free, with an account
An account costs nothing and opens every lesson in this track that is not marked Pro, on every device you read on.
What is inside Arrays of Structs, and Structs in Functions
- An array of structs: a capacity and a count
- Reading n records from the input
- Finding a record by a field
- Sorting records: move the whole struct
- Bob's sort moves one field
- A struct passed to a function is a copy
- Returning a struct from a function