Structs
Key Points:
- Structs work like in C or C++.
- Like in C++, and unlike in C, no typedef is needed to define a type.
- Methods are defined in an block, which we will see in following slides.
- This may be a good time to let people know there are different types of structs.
- The next slide will introduce Tuple structs, used when the field names are not important.
- The syntax allows us to copy the majority of the fields from the old struct without having to explicitly type it all out. It must always be the last element.