title: Some basic questions on constructors (and multiple-inheritance) in C++?
body: <p><em>(I’m sorry if this has been asked before; the search feature seems to be broken: the results area is completely blank, even though it says there are a few pages of results… in Chrome, FireFox, and Safari)</em></p>
  
  <p>So, I’m just learning C++… and the book I’m moving through is doing a <em>really</em> bad job of explaining constructors in a way that I can grasp them. I’ve pretty much grokked everything else so far, but I can’t figure out how the syntax for constructors actually works.</p>
  
  <p>For instance, I am told that the following will cause the constructor to call the designated superclass’s constructor:</p>
  
  <pre><code>class something : something_else {
    something(int foo, double bar) : something_else(int foo) {}
  };
  </code></pre>
  
  <p>On the other hand, that same syntax was utilized later on in the book, when describing how to initialize <code>const</code> members:</p>
  
  <pre><code>class something : something_else {
  private:  const int constant_member;
  public:   something(int foo, double bar) : constant_member(42) {}
  };
  </code></pre>
  
  <p>So… uh… what the hell is going on there? What does the syntax <code>rv signature(param) : something_else(what);</code> actually <strong>mean</strong>? I can’t figure out what that <code>something_else(what)</code> is, with relation to the code around it. It seems to take on multiple meanings; I’m sure there must be some underlying element of the language that it corresponds to, I just can’t figure out <em>what</em>.</p>
  
  <p><strong>Edit:</strong> Also, I should mention, it’s very confusing that the <code>what</code> in the previous example is sometimes a parameter list (so <code>something_else(what)</code> looks like a function signature)… and sometimes a constant-value expression (so <code>something_else(what)</code> looks like a function call).</p>
  
  <p>Now, moving on: What about multiple-inheritance and constructors? How can I specify what constructors from which parent classes are called… and which ones are called by default? I’m aware that, by default, the following two are the same… but I’m not sure what the equivalent is when multiple-inheritance is involved:</p>
  
  <pre><code>class something : something_else {
  //something(int foo, double bar) : something_else() {}
    something(int foo, double bar) {}
  };
  </code></pre>
  
  <p>Any help in grokking these topics would be very appreciated; I don’t like this feeling that I’m failing to understand something basic. I don’t like it <em>at all</em>.</p>
  
  <p><strong>Edit 2:</strong> Okay, the answers below as of now are all really helpful. They raise one more portion of this question though: How do the arguments of base-class-constructor-calls in ‘initialization lists’ relate to the constructor you’re defining? Do they have to match… do there have to be defaults? How much do they have to match? In other words, which of the following are <em>illegal</em>:</p>
  
  <pre><code>class something_else {
    something_else(int foo, double bar = 0.0) {}
    something_else(double gaz) {}
  };
  
  
  class something : something_else {
    something(int foo, double bar)  : something_else(int foo, double bar) {}   };
  class something : something_else {
    something(int foo)              : something_else(int foo, double bar) {}   };
  class something : something_else {
    something(double bar, int foo)  : something_else(double gaz) {}   };
  </code></pre>