All pastes #832192 Raw Edit

Something

public text v1 · immutable
#832192 ·published 2007-12-25 22:20 UTC
rendered paste body
class mycls {int a,b;
public:
mycls(int m, int n) {a=m; b=n;}
friend int Fn(mycls ob);
};
int Fn(mycls ob)

{mycls=temp;
temp.a=temp.a*temp.a;
temp.b=temp.b*temp.b;
return temp;
}
int main()
{mycls ob1(10,13), ob2(0,0);
ob2=Fn(ob1);
return 0;
}

/*---------------------*/ 



class mycls {int a,b;
public:
mycls(int m, int n) {a=m; b=n;}
friend int Fn(mycls ob);
};
int Fn(mycls ob){return a+b;}

int main()
{mycls ob1(10,15);
int res;
res=Fn(ob1);

return 0;
}


/*---------------------*/ 


class mycls {int a,b;
public:
void set(inti, int j) {a=i; b=j;}
void show()
{cout<<a<<' '<<b<<main() void};
{ mycls ob1, ob2;
ob1.set(10,5);
ob2.set(10,3);
if (ob1=ob2) cout<<"er";
else {ob1.show(); ob2.show();}
}


/*---------------------*/ 

class mycls {int a,b;
public:
mycls(int m, int n) {a=m; b=n;}
friend mycls Fn(mycls ob);
};

mycls &Fn(mycls ob) 
{a=a*a;
b=b*b;
return this;}
int main()
{mycls ob1(10,15), ob2(0,0);
ob2=Fn(ob1);

return 0;
};

/*---------------------*/ 


class my_cls{ int x;
public:
my_cls(int n){x=n;}
void set_x(int n) {x=n;}
int get_x(){return x;}
};
void cube (my_cls &object)
{object.set_x(pow(object.get_x(),3))
cout<<object.get_x()<<endl;
}
int main()
{my_cls.ob(10);
cube(ob);
cout<<ob.get_x()<<endl;
return 0;
}

/*---------------------*/ 


class mycls {
public:
int a,b;
mycls(int m, int n) {a=m; b=n;}
friend int Fn(mycls ob){return ob.a+ob.b;};



int main()
{mycls ob1(10,15);
int res;
res=Fn(ob1);

return 0;
}


/*---------------------*/ 


class MyCLs {int x;
public:
MyCLs(){x=0;}
int get_x(){return x;}
};

void main()
{MyCLs*obPtr;
MyCLs ob_arr[10]={1,2,3,4,5,6,7,8,9,10};
obPtr=new MyCLs[10];
for (int i=0;i<10;i++) cout<<ob_arr.get_x()<<' ';
for (int i=0;i<10;i++)
{obPtr=i;
cout<<OBPTR.GET_X();}
}


/*---------------------*/ 

class MyCls{int a,b;
public:
void set(int i;int j){a=i; b=j;}
void show()
{cout<<a<<' '<<b<<endl;}
};
class YourCls {int a,b;
public:
void set(int i,int j){a=i; b=j;}
void show(){cout<<a<<' '<<B<< main() void };> 

{MyCls ob1;
YourCls ob2;
ob1.set(10,5);
ob2=ob1;
ob1.show();
ob2.show();}

/*---------------------*/