#include"X.h"
#include"Y.h"
int main()
{
Y b(10,"stringy");
X a(10,"stringx");
b.show(a);
return 0;
}
#ifndef X_H_INCLUDED
#define X_H_INCLUDED
class X
{
public:
int x;
char *strx;
public:
X(int a,char *str)
{
x=a;
strx=new char[strlen(str)+1];
strcpy(strx,str);
}
friend void show(X &ob);
};
#endif // X_H_INCLUDED
#ifndef Y_H_INCLUDED
#define Y_H_INCLUDED
#include"X.h"
#include<string>
#include<cstring>
#include<iostream>
using namespace std;
class X;
class Y
{
int y;
char *stry;
public:
Y(int b,char *str)
{
y=b;
stry = new char[strlen(str)+1];
strcpy(stry,str);
}
void show(X &ob)
{
cout<<"the string of y is:"<<stry<<endl;
cout<<"the string of x is:"<<ob.strx<<endl;
}
};
#endif // Y_H_INCLUDED