title: Tryiing to overload the post increment operator in c++ in but the answer is not as expected
body: <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class B{
          int temp1;
      public :
          void disp()
          {   
          cout &lt;&lt;temp1;
          }
          void setA(int a)
          {
              temp1=a;
          }       
          void operator ++(int)
          {
              temp1+=5;
          }
          void cal()
          {
              temp1 ++;
          }
          };  
  
  int main()
  {
      B b; 
      b.setA(10);
  
      b.cal();
      b.disp();
      return 0;
  }
  </code></pre>
  
  <p>I recently learned about operator overloading so playing around with code .....so the expected answer here is 15 but it is appearing as 11. Why is my overloaded operator not working...and specifically what is wrong with this code rsince there seems to be a logical error in this part:</p>
  
  <pre><code>void operator ++(int)
          {
              temp1+=5;
          }
          void cal()
          {
              temp1 ++;
          }
  </code></pre>