class A {
private:
char a;
char sub_f(char *);
public:
A();
char f(char* ) {some actions using sub_f(char*);}
};
class B {
private:
char b;
public:
B();
void execute() { b = f("some text");} //PROBLEM IS HERE
}
Can smb explain me how can I call f(char *)
function which is a member of class A, from the void B::execute()
? I can't compile it right now. If I make f(char*)
a friend function of the class A, there is another problem appear :
friend f(char*)
doesn't know anything about private function sub_f(char*)
.
I am a beginner in C++ and will be appreciate for full answers with explanation.