#include <iostream.h>
#include <conio.h>
#include <string.h>
class gabung{
friend ostream& operator<<(ostream&,gabung&);
friend istream& operator>>(istream&,gabung&);
public:
void kata();
private:
char kata1[10];
};
istream&operator>>(istream&in,gabung&x){
cout<<"\nmasukian bilangan 1 :";
in>>x.kata1;
cout<<"masukan bilangan 2 :";
in>>x.kata2;
x.kata();
return in;
}
ostream&operator<<(ostream& out,gabung&x)
{
out<<"hailnya :"<<x.kata1<<endl;
return out;
}
void gabung::kata(){
strcat(kata1,kata2);
cout<<"kata gabungan : "<<kata1<<endl;
}
void main(){
gabung a;
cin>>a;
cout<<a;
getch();
return 0;
}
0 komentar:
Posting Komentar