Structs

Group related data into custom types. Learn to define structs, access members, pass them to functions, and build organized data structures.

44 lessons
173 min

Lessons

1. Intro

Why structs matter

4m

2. What is a Struct?

Grouping related data

4m

3. Defining a Struct

How to create one

4m

4. Creating Struct Variables

Making actual objects

4m

5. Accessing Members

Getting to the data

4m

6. Quiz: Struct Basics

Struct access

2m1 problems

7. Modifying Members

Updating struct values

4m

8. Initializing Structs

Different init methods

4m

9. Quiz: Custom data types

Custom data types

3m1 problems

10. Default Values

What happens without init

4m

11. Structs with Arrays

Arrays inside structs

4m

12. Arrays of Structs

Storing many structs

4m

13. Quiz: Custom data types

Custom data types

3m1 problems

14. Nested Access

Multiple levels deep

4m

15. Passing Structs to Functions

Functions with struct params

4m

16. Pass by Value

How structs are passed

4m

17. Quiz: Custom data types

Custom data types

3m1 problems

18. Pass by Reference

Efficiency with references

4m

19. Const References

Safe and efficient

4m

20. Quiz: Variable alias

Variable alias

3m1 problems

21. Returning Structs

Functions that give structs

4m

22. Nested Structs

Composition patterns

4m

23. Accessing Nested Members

Chaining member access

4m

24. Quiz: Nested Structs

Test your understanding

3m1 problems

25. Structs vs Classes

What's the difference

4m

26. Problem - Point Distance

Distance between points

4m1 problems

27. Problem - Student Records

Track student information

4m1 problems

28. Problem - Rectangle Area

Calculate from corners

4m1 problems

29. Quiz: Struct Applications

Test your understanding

3m1 problems

30. Common Mistakes

Typical errors

4m

31. When to Use Structs

Making the choice

4m

32. Problem - Young Physicist

Equilibrium with structs

4m1 problems

33. Young Physicist - The Idea

Group related coordinates

4m

34. Young Physicist - Algorithm

Breaking down the solution

4m

35. Quiz: Custom data types

Custom data types

3m1 problems

36. Young Physicist - Implementation

Complete solution

7m1 problems

37. Lessons from Young Physicist

summary

4m

38. Problem - Games

Counting uniform conflicts

4m1 problems

39. Games - The Idea

Bundle related attributes

4m

40. Games - Algorithm

Breaking down the solution

4m

41. Quiz: Custom data types

Custom data types

3m1 problems

42. Games - Implementation

Complete solution

7m1 problems

43. Lessons from Games

summary

4m

44. Section Recap

What we learned

5m

Ready to start learning?

Access all 44 lessons with interactive content and progress tracking.