Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  hello
Language: C/C++
Code:
#include <iostream>
using namespace std;
class temp
{
   private:
      int count;
   public:
       temp():count(5){  }
       void operator ++() { 
        count=count+1; 
       }
       void Display() { cout<<"Count: "<<count; }
};
int main()
{
    temp t;
    ++t;        /* operator function void operator ++() is called */
    t.Display();
    return 0;
}
          
Comments: