C2201: Initializers have too many dimensions

[ERROR]

Description

An initialization of an array of class objects with constructor call arguments was having more opening braces than dimensions of the array.

Example
  struct A {

  
    A(int);

  
  };

  
  void main() {

  
    A a[3]={{3,4},4}; // errors

  
    A a[3]={3,4,4};   // ok

  
  }

  
Tips

Provide the same number of opening braces in an initialization of an array of class objects.

See also