# include <iostream.h>
# include <conio.h>
# include <string.h>
class str
{
char *name;
int len;
public:
str()
{
len=0;
name=newchar[len+1];
}
str(char *s)
{
len=strlen(s);
name=newchar[len+1];
strcpy(name,s);
}
void show()
{
cout<<"NAME IS:->"<<name<<endl;
}
void join(str &a,str &b);
};
void str::join(str &a,str &b)
{
len=a.len+b.len;
delete new;
name=newchar[len+1];
strcpy(name,a.name);
strcat(name,b.name);
};
main()
{
clrscr();
char *first="HARSHIL";
str n1(first),n2("NINAD"),n3("PRATIK"),n4,n5;
n4.join(n1,n2);
n5.join(n4,n3);
n1.show();
n2.show();
n3.show();
n4.show();
n5.show();
}