Structs
Group related data into custom types. Learn to define structs, access members, pass them to functions, and build organized data structures.
Lessons
1. Intro
Why structs matter
2. What is a Struct?
Grouping related data
3. Defining a Struct
How to create one
4. Creating Struct Variables
Making actual objects
5. Accessing Members
Getting to the data
6. Quiz: Struct Basics
Struct access
7. Modifying Members
Updating struct values
8. Initializing Structs
Different init methods
9. Quiz: Custom data types
Custom data types
10. Default Values
What happens without init
11. Structs with Arrays
Arrays inside structs
12. Arrays of Structs
Storing many structs
13. Quiz: Custom data types
Custom data types
14. Nested Access
Multiple levels deep
15. Passing Structs to Functions
Functions with struct params
16. Pass by Value
How structs are passed
17. Quiz: Custom data types
Custom data types
18. Pass by Reference
Efficiency with references
19. Const References
Safe and efficient
20. Quiz: Variable alias
Variable alias
21. Returning Structs
Functions that give structs
22. Nested Structs
Composition patterns
23. Accessing Nested Members
Chaining member access
24. Quiz: Nested Structs
Test your understanding
25. Structs vs Classes
What's the difference
26. Problem - Point Distance
Distance between points
27. Problem - Student Records
Track student information
28. Problem - Rectangle Area
Calculate from corners
29. Quiz: Struct Applications
Test your understanding
30. Common Mistakes
Typical errors
31. When to Use Structs
Making the choice
32. Problem - Young Physicist
Equilibrium with structs
33. Young Physicist - The Idea
Group related coordinates
34. Young Physicist - Algorithm
Breaking down the solution
35. Quiz: Custom data types
Custom data types
36. Young Physicist - Implementation
Complete solution
37. Lessons from Young Physicist
summary
38. Problem - Games
Counting uniform conflicts
39. Games - The Idea
Bundle related attributes
40. Games - Algorithm
Breaking down the solution
41. Quiz: Custom data types
Custom data types
42. Games - Implementation
Complete solution
43. Lessons from Games
summary
44. Section Recap
What we learned