title: Initialize vector<Temp> myVector(10);
body: <p>According to Absolute c++ books: </p>
  
  <blockquote>
  <pre><code>vector&lt;AClass&gt; records(20); // vector consctructer uses the
                               // default constructor for AClass to initialize 20 elements.
  </code></pre>
  </blockquote>
  
  <p>temp.h</p>
  
  <pre><code>#ifndef TEMP_H
  #define TEMP_H
  
  class Temp {
  public:
      Temp();
      static int b;
  };
  #endif /* TEMP_H */
  </code></pre>
  
  <p>temp.cpp </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "temp.h"
  
  using namespace std;
  
  int Temp::b=9; // static value for control 
  
  Temp::Temp(){
      cout&lt;&lt;"Initialize";
      ++b;
  }
  </code></pre>
  
  <p>main.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include "temp.h"
  
  using namespace std;
  
  int main(int argc, char** argv) {
  
      vector&lt;Temp&gt; a(10); // 10 elements
  
      cout&lt;&lt;Temp::b;
  
      return 0;
  }
  </code></pre>
  
  <p>And my result's : 
     <code>Initialize10;</code> </p>
  
  <p>As you can see just one times constuctor called. Why its happened? I'm confused. </p>