Half hand operator program.

Words
74
Reading
1 min
9y
Listen to this post
~1 min

Hey steemit and steemians.

lets look at hand hand operator  Subtraction (-) program.

Using C++

Program Body:

#include <iostream>

#include <string>

using namespace std;

class damon{

int a;

public:

    damon(){

    a=0;

    }

    damon(int b){

    a=b;

    }

    void operator-=(int wolf){

    a=a-wolf;

    }

    void depict(){

    cout<<a<<endl;

    }

};

int main (){

damon vamp(80);

vamp-=10;

vamp.depict();

return 0;

}

Working:

the object of class is  Subtracted it is for single one.

Thanks I hope you  liked it