Objects 2 - Pointers


examples


Classwork

From now on, when you use variables based on classes, use a pointer to a class type instead of the class type by itself, using * to indicate that it is a reference.

Create a class representing an Otter which has a name, a number of fish, and a bestFriend, which is another Otter. In a main, create two Otters, Nigel and Clive, who are each others best friends.  Give Nigel's best friend 3 fish.  Give Clive's best friend's best friend's best friend's best friend 7 fish (write your code to reflect the way the problem is written).