Home > Back-end >  c
c

Time:10-01

The definition of class A in the header file a.h,

Class A {
Public:
Void the Display () const {
Cout<& lt;" The argment is NULL "& lt; }

Void the Display (const char * STR) const {
Cout<& lt;" The argment is "& lt; }
Void OtherFunc () {
}
};

The main function is written in the mainApp. CPP file,
Int main (int arg c, char * argv [])
{
A, aA.

If (argc> 1) {
AA. The Display (argv [1]);
} else {
AA. The Display ();
}

Cout
return 0;
}
Class B {
Public:
B (A& AA) {pA=& amp; AA; }
Void Func () {
Cout<& lt;" This is member function Func () "& lt; }
Void NewFunc ()
{
PA - & gt; OtherFunc ();
}

Private:
A * pA;
};
What will B NewFunc function implementation, in the form of communications in the b.h can how to write?