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.
Checking what this lesson needs for you…
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