← All lectures

Lecture 24 · 35 min

Array of Structures & Nested Structures

Arrays whose elements are structs — for storing many records — and structures that contain other structures as members.

Array of structElement accessNested structuresDot chaining
Slide 1 / 14

Why array of structs?

A single struct holds ONE record (one student, one book, one point). But real programs deal with MANY records.

An array of structs gives you a collection of records, all of the same type:

  • 100 students
  • 50 books
  • 1000 sales records
← / → navigateF fullscreenEsc exit⌘K search