Write a program to show object as function argument.
#include<iostream.h>
#include<conio.h>
#include<string.h>
class objarg
{
char str[10];
public:
void get()
{
cout<<"\n Enter a Message";
cin>>str;
}
void copy(objarg o)
{
strcpy(str,o.str);
}
void display()
{
cout<<"\n Message is "<<str;
}
};
void main()
{
objarg o1, o2;
clrscr();
o1.get();
o2.copy(o1);
o2.display();
getch();
}