Half hand operator program

in programming •  7 years ago 

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;

}

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!