Records (Structs)
Records (Structs)
Records (structs)
Objectives
In this chapter, you will:
• Learn about records (structs)
• Examine operations on a struct
• Manipulate data using a struct
• Learn about the relationship between a
struct and functions
• Discover how arrays are used in a struct
• Create an array of struct items
C++ Programming: From Problem Analysis to Program Design, Sixth Edition 2
Records (structs)
• struct: collection of a fixed number of
components (members), accessed by name
– Members may be of different types
• Syntax: