A
Allan Bruce
I have made a struct which has several fields and I initialise like this:
MyStruct foo = {a, b, c, d, e};
I just added another field to the struct at the end, and I thought I would
have to add this new field to all of the initialisers but I dont, is this
defined behaviour?
Thanks
Allan
Here is my code:
/* define struct */
typedef struct
{
HWND xiParentWnd;
const char *xiCaption;
const char *xiTitle;
DWORD xiFlags;
DWORD xiNotifyMsg;
bool AutoDelete;
} AsyncMessageBoxInfo;
/* an example initialising the strcut */
AsyncMessageBoxInfo lAMBI = {NULL, "User is no longer logged in",
mRemoteUser, MB_OK | WS_EX_TOPMOST, NULL};
MyStruct foo = {a, b, c, d, e};
I just added another field to the struct at the end, and I thought I would
have to add this new field to all of the initialisers but I dont, is this
defined behaviour?
Thanks
Allan
Here is my code:
/* define struct */
typedef struct
{
HWND xiParentWnd;
const char *xiCaption;
const char *xiTitle;
DWORD xiFlags;
DWORD xiNotifyMsg;
bool AutoDelete;
} AsyncMessageBoxInfo;
/* an example initialising the strcut */
AsyncMessageBoxInfo lAMBI = {NULL, "User is no longer logged in",
mRemoteUser, MB_OK | WS_EX_TOPMOST, NULL};