In: Computer Science
Class object in C++ programming language description about lesson unary overloading function example.
#include
using namespace std;
class num{
private:
int x;
float y;
char gender;
public:
num(int x=0,float y=0)
:x(x),y(y){
cout<<"\ninitzulize constructor = "< } num copy(){ //? return *this; } void print(){ cout<<"print this = "< cout<<"x="< cout<<"Address: "<<&p2< p1.print(); p2=p1.copy(); cout< p2.print(); p1.increment(8,3); p1.print(); p2.print(); p1.decrement(5,2); cout< p1.print(); p2.print(); }