Copying objects to other

#include<iostream>
using namespace std;
class myclass
{
int i;
public:
void set(int n) {i=n;}
int show() {return 1;}
};
int main()
{
myclass ob1,ob2;
ob1.set(99);
ob2=ob1;
cout<<“this is ob2’s “<<ob2.show();
return 0;
}

Advertisements