title: pointer to class objects initialization with class constructor?
body: <pre><code>// pointer to classes example
  // runs with no problem
  #include &lt;iostream&gt;
  using namespace std;
  
  class Rectangle {
    int width, height;
  public:
    Rectangle(int x, int y) : width(x), height(y) {}
    int area(void) { return width * height; }
  };
  
  
  int main() {
    Rectangle obj (3, 4);
    Rectangle * foo, * bar, * baz;
    foo = &amp;obj;
    bar = new Rectangle (5, 6);
    baz = new Rectangle[2] { {2,5}, {3,6} };
    cout &lt;&lt; "obj's area: " &lt;&lt; obj.area() &lt;&lt; '\n';
    cout &lt;&lt; "*foo's area: " &lt;&lt; foo-&gt;area() &lt;&lt; '\n';
    cout &lt;&lt; "*bar's area: " &lt;&lt; bar-&gt;area() &lt;&lt; '\n';
    cout &lt;&lt; "baz[0]'s area:" &lt;&lt; baz[0].area() &lt;&lt; '\n';
    cout &lt;&lt; "baz[1]'s area:" &lt;&lt; baz[1].area() &lt;&lt; '\n';       
    delete bar;
    delete[] baz;
    return 0;
  }   
  </code></pre>
  
  <p>I am a bit (no pun intended) confused about this line of code here:</p>
  
  <pre><code>baz = new Rectangle[2] {{2,5}, {3,6}};
  </code></pre>
  
  <p>I've seen code like:</p>
  
  <pre><code>int *foo = new int[3] {1,2,3};
  </code></pre>
  
  <p>and I totally understand it. But what's the syntax of <code>{{2,5}, {3,6}}</code> here? How can array of class objects be initialized like this? I've searched many online c++ references but have no clue.</p>