Learn C Programming

Lesson 2 of 9 · Structures, Unions and Enums

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

  1. An array of structs: a capacity and a count
  2. Reading n records from the input
  3. Finding a record by a field
  4. Sorting records: move the whole struct
  5. Bob's sort moves one field
  6. A struct passed to a function is a copy
  7. Returning a struct from a function