Welcome Guest.

0Answers

Operator overloading

Asked by: Betty Walker 183 views IT June 9, 2018

class test

{

   public:

        test();

        test operator++();

   private:

       int a;

};

test test::operator++()

{

    test temp;

   temp.a=++a;

   return temp;

}

单目运算符为什么这样定义不可以?

0 Answers