So I was working with socket programming in windows and I came upon this struct.
#define WSADESCRIPTION_LEN 256
#define WSASYS_STATUS_LEN 128
typedef struct WSAData {
WORD wVersion;
WORD wHighVersion;
#ifdef _WIN64
unsigned short iMaxSockets;
unsigned short iMaxUdpDg;
char *lpVendorInfo;
char szDescription[WSADESCRIPTION_LEN+1];
char szSystemStatus[WSASYS_STATUS_LEN+1];
#else
char szDescription[WSADESCRIPTION_LEN+1];
char szSystemStatus[WSASYS_STATUS_LEN+1];
unsigned short iMaxSockets;
unsigned short iMaxUdpDg;
char *lpVendorInfo;
#endif
} WSADATA, *LPWSADATA;
You can see the struct members are same for each condition only the placement is different.
Why actually is this done? Is it relevant to new programmers like me?
and can I just carry on my tasks without any worry or should I look upon this more seriously?
Only for padding.
Don't think about it.