C++ TutorialLesson 20Free preview
C++ Structures
This lesson is part of C++ · All levels
Summary
This lesson discusses struct, a custom data type that combines several variables of different types in one container. With struct, interrelated data like names, ages, and values can be grouped into one object. You learn to declare a structure and access each member using a point.
Key points
- Struct is declared with the keyword struct followed by the type name.
- Each struct member has its own name and data type.
- The struct object member is accessible by point operators (e.g. mhs.nama).
- For struct pointers the arrow operator (ptr->member) is used.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.