title: Class constructors, overloaded constructors and object initialization
body: <p>From the <a href="http://www.cplusplus.com/doc/tutorial/" rel="nofollow">C++ tutorial</a>, chapter Classes (I), Overloading constructors:</p>
  
  <blockquote>
    <p>But this example also introduces a special kind constructor: the default constructor. The default constructor is the constructor that takes no parameters, and it is special because it is called when an object is declared but is not initialized with any arguments. In the example above, the default constructor is called for rectb. Note how rectb is not even constructed with an empty set of parentheses - in fact, empty parentheses cannot be used to call the default constructor:</p>
  </blockquote>
  
  <pre><code>Rectangle rectb;   // ok, default constructor called
  Rectangle rectc(); // oops, default constructor NOT called 
  </code></pre>
  
  <blockquote>
    <p>This is because the empty set of parentheses would make of rectc a function declaration instead of an object declaration: It would be a function that takes no arguments and returns a value of type Rectangle.</p>
  </blockquote>
  
  <p>So, from what I understand:</p>
  
  <pre><code>class someclass {
      public:
          someclass() {
              std::cout &lt;&lt; "Default constructor" &lt;&lt; std::endl;
          }
          someclass(int arg) {
              std::cout &lt;&lt; "Constructor that uses passed argument (" &lt;&lt; arg &lt;&lt; " in this case)" &lt;&lt; std::endl;
          }
  };
  
  
  int main() {
      someclass object1;
      //outputs "Default constructor"
  
      someclass object2(1294);
      //outputs "Constructor that uses passed argument (1294 in this case)"
  }
  </code></pre>
  
  <p>But how do I define a constructor which gets called as <code>someclass object();</code>? My thoughts were <code>someclass(void) {}</code> (not sure about this) or using a default value for the arguments (<code>someclass(int arg = 1294) {}</code>), but how is this case correctly handled?</p>