23.4 — Association

In the previous two lessons, we’ve looked at two types of object composition, composition and aggregation. Object composition is used to model relationships where a complex object is built from one or more simpler objects (parts). In this lesson, we’ll take a look at a weaker type of relationship between …

23.1 — Object relationships

Life is full of recurring patterns, relationships, and hierarchies between objects. By exploring and understanding these, we can gain insight into how real-life objects behave, enhancing our understanding of those objects. For example, let’s say one day you’re walking down the street, and you see a bright yellow object attached …

2.12 — Header guards

In lesson , we noted that a variable or function identifier can only have one definition (the one definition rule). Thus, a program that defines a variable identifier more than once will cause a compile error: int main() { int x; // this is a definition for variable x int …