#include
class MyClassB;
class MyClassA
{
char *name;
public:
MyClassA(char *s){name=s;}
friend void print(MyClassA &,MyClassB &);
};
class MyClassB
{
char *name;
public:
MyClassB(char *s){name=s;}
friend void print(MyClassA &,MyClassB &);
};
void print(MyClassA &a,MyClassB &b)
{
cout<<"the MyClassA is"< cout<<"the MyClassB is"< }
int main()
{
MyClassA s("Li Hu");
MyClassB t("Wan Ping");
print(s,t);
}
the MyClassA isLi Hu
the MyClassB isWan Ping