struct的初始化
struct WindowsParams {
DWORD pidOwner = NULL;
wstring wndClassName = L"";
wstring wndName = L"";
RECT pos = { 0, 0, 0, 0 };
POINT res = { 0, 0 };
float percentAllScreens = 0.0f;
float percentMainScreen = 0.0f;
DWORD style = NULL;
DWORD styleEx = NULL;
bool satisfyAllCriteria = false;
vector<HWND> hwnds;
};
阅读前人的源码,发现struct直接初始化赋值,这怎么可能呢?我编译的时候报错
struct定义的时候不是不能初始化吗?
前人写的初始化,怎么通过编译的呢?
难道是编译器的问题吗?vs2010编译器无法通过