I've tried to figure this out for an hour now and I've gotten nowhere.
I have a class with a friend
function and private
members but I am getting a compiler error telling me that I cannot access a private
member using that friend
function.
line 36 error: 'family* family::famPtr' is private
The friend
prototype is as follows within the class body
friend void output(family *famPtr);
The private members are as such:
private:
string husband;
string wife;
string son;
string daughter1;
string daughter2;
family *famPtr;
And this is the function call itself within the main function for a family
object Simpson
.
output(Simpson.famPtr);
I'm not sure where I'm messing up here, it seems relatively simple and my textbook is getting me nowhere and none of the things I've found on here have led me in the right direction.