This msdn page shows how INPUT is defined.
typedef struct tagINPUT {
DWORD type;
union {
MOUSEINPUT mi;
KEYBDINPUT ki;
HARDWAREINPUT hi;
} DUMMYUNIONNAME;
} INPUT, *PINPUT, *LPINPUT;
Case 1
#include <windows.h>
int main()
{
INPUT input = { 0 };
input.DUMMYUNIONNAME.ki.wScan = 0x12;
}
Case 2
#include <windows.h>
int main()
{
INPUT input = { 0 };
input.ki.wScan = 0x12;
}
But case 1 isn't compiled with g++ compiler but case 2 is compiled with no diagnostic messages. When considering the definition of INPUT, the results seem reversed. Am I missing a point?