15 Structs and Classes
Structures (commonly referred to as structs) and classes are the pillars on which you build your applications. They provide important mechanisms to model the things you wish to represent in your code.
You are going to transition from the playground and create a command-line tool, which you will work in for the next several chapters. Your command-line tool project will represent a town undergoing a serious monster infestation. You will use both structs and classes to model these entities and will give them properties to store data and functions so that these entities can do some work.
As you will see, structs and classes have similarities and differences. Which to use for any particular situation is an important ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access