← All lectures

Lecture 23 · 40 min

Structures in C++

User-defined types that bundle several related values of different types into one record.

structMember accessInitializationFunctions with structstypedef
Slide 1 / 15

The limitation of arrays — and how structs fix it

Arrays store many values of the same type. But real-world data is mixed:

A student record has: name (char[]), ID (int), GPA (float), and grade (char).

You can't store all of these in one array! A structure groups values of different types into a single user-defined type.

← / → navigateF fullscreenEsc exit⌘K search