title: Object array initialization without default constructor
body: <pre><code>#include &lt;iostream&gt;
  class Car
  {
  private:
    Car(){};
    int _no;
  public:
    Car(int no)
    {
      _no=no;
    }
    void printNo()
    {
      std::cout&lt;&lt;_no&lt;&lt;std::endl;
    }
  };
  void printCarNumbers(Car *cars, int length)
  {
      for(int i = 0; i&lt;length;i++)
           std::cout&lt;&lt;cars[i].printNo();
  }
  
  int main()
  {
    int userInput = 10;
    Car *mycars = new Car[userInput];
    for(int i =0;i &lt; userInput;i++)
           mycars[i]=new Car[i+1];
    printCarNumbers(mycars,userInput);
    return 0;
  }    
  </code></pre>
  
  <p>I want to create a car array but I get the following error:</p>
  
  <pre><code>cartest.cpp: In function ‘int main()’:
  cartest.cpp:5: error: ‘Car::Car()’ is private
  cartest.cpp:21: error: within this context
  </code></pre>
  
  <p>is there a way to make this initialization without making Car() constructor public?</p>