Compiler error c2552 non-aggregates cannot be initialized with initializer list. This error beacuse of the following .....
The specified identifier was incorrectly initialized.
An initializer list is needed to initialize the following types:
1) An Array
2) A class, structure, or union that does not have constructors, private or protected members, base classes, or virtual functions
These types are known as "aggregates ."
Sample Code ....
Code
// CLR. cpp: Main project file.
# Include "stdafx. H"
# DEFINE _ afxdll
# Include "afx. H"
# Include <strsafe. h>
# Include <iostream>
Using namespace STD;
Using namespace system;
Using namespace system: diagnostics;
Typedef struct _ myoverlapped: Public overlapped {
Int I;
} Myoverlapped, * pmyoverlapped;
Int main (array <system: String ^> ^ ARGs ){
Myoverlapped my = {0}; // my has base class, so this line will generate compiler error c2552
Cout <my. I <Endl;
System ("pause ");
Return 0;
}