I have a class that contains objects of two other classes. I need one of the classes to be able to get data from the other one. Here’s an example.
class Nom{ /*says what we're eating*/ };
class Chew{ /*stuff that needs to know about what we are eating from nom*/ };
class BigBurrito
{
Nom n;
Chew c;
};
How about passing a pointer to the instance of
NomintoChew? Along these lines: