This documentation is archived and is not being maintained.

Compiler Error C2078

Error Message

too many initializers

The number of initializers exceeds the number of objects to be initialized.

The following sample generates C2078:

// C2078.cpp
int main() {
   int d[2] = {1, 2, 3};   // C2078
   int e[2] = {1, 2};   // OK

   char a[]={"a", "b"};   // C2078
   char *b[]={"a", "b"};   // OK
   char c[]={'a', 'b'};   // OK
}
Show: