title: When i overload constructor it doesn't work properly C++
body: <pre><code>class sum
  {
      protected:
          int num, rang;
      public:
          sum(){
              cin &gt;&gt; num;
              cin &gt;&gt; rang;
          }
          sum(int num, int rang){
              int n = 10;
              int sum = 0;
              for(int i = 0; i &lt; rang; i++){
                  num += n; 
                  sum += num;
              }
              num = sum;
              cout &lt;&lt; num &lt;&lt; '\n';
          }
  };
  
  int main()
  {
      sum obj;    
      return 0;
  }
  </code></pre>
  <p>When I call second costructor (overload constructor), it should print sum, but it prints nothing, I think it even isn't calling by previous censtructor, why?</p>