CodePudding user response:
Class A
{
Protected:
(A) {printf (" created A "); };
Public:
Friend class CB.
};
The class CB
{
Public:
The static
A * CreateA ()
{
The return of new A;
}
};
CodePudding user response:
Class A
{
Protected:
(A) {printf (" created A "); };
Public:
Friend class CB.
};
The class CB
{
Public:
The static
A * CreateA ()
{
The return of new A;
}
};