Compiler Error C2075

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C2075.

identifier' : array initialization needs curly braces

There were no curly braces around the specified array initializer.

The following sample generates C2075:

// C2075.c  
int main() {  
   int i[] = 1, 2, 3 };   // C2075  
}  

Possible resolution:

// C2075b.c  
int main() {  
   int j[] = { 1, 2, 3 };  
}  

Show: