title: C++ How do I to put this constructor in a cpp file?
body: <p>I have a constructor in the <code>.h</code> file</p>
  
  <pre><code>C(std::string s = "",int i = 0,double d = 1)
  {
      dataMember1 = s;
      dataMember2 = i;    
      dataMember3 = d;
  }
  </code></pre>
  
  <p>If you provide the values of the string, int and double it will use those values, however without them, it will use the default ones. My question is how to refactor this so that I put it in a <code>.cpp</code> file.</p>
  
  <p>When not refactoring it works fine for example if I declare</p>
  
  <p><code>C object1("object1", 0, 1), object2;</code> it will work, however if I refactor, the <code>object2</code> will cause a compile error saying that I don't have a <code>C()</code> constructor</p>