Great job learning about structures! We’ve covered many important topics:
- Structures allow you to create user-defined data types
- Structures can package together other data types into one type
- You can define a structure using the
- When defining a structure, the member variables are declared but not instantiated
- Structures help programs work with complex data and can represent real-world objects
- You can access member variables with the dot operator
- You can have a pointer to a structure and access its member variables using the arrow operator
- You can pass structures and structure pointers to functions
- You can return structures from functions
With our understanding of structures, we can now create and work with complicated data types easily and efficiently.
Use the code in the workspace to play around with structures.
What can you add to the
What are some functions that would help act on the structure?