Sorry if this one hits a little close to home.
Source https://www.learncpp.com/cpp-tutorial/friend-classes-and-friend-member-functions/
Sorry if this one hits a little close to home.
Source https://www.learncpp.com/cpp-tutorial/friend-classes-and-friend-member-functions/
I’m not an advanced reader yet, but I’m guessing that “deriving” is some other thing you can do with classes than making them a friend.
Generally speaking, in object oriented programming there are ways to derive one class from another. So if you have a Car class, but you decide that it would actually make sense to have a Truck class as well, you can use Car as a starting point, inherit all of its properties, and then just change the specific parts that are different for the Truck class. This saves repeating work, and allows you to build in layers; instead of Car and Truck you might start with a Vehicle class, then derive a GroundVehicle class from that, then a Bike, Car and Truck class from GroundVehicle, and so on.