What is the purpose of ANYSIZE_ARRAY in <winnt.h>?
2 answers
I assume you are talking about this blog post .
It is often used when a variable-size array (unknown at compile time) is part of the structure:
typedef struct {
int CommonFlags
int CountOfThings;
THING Things[ANYSIZE_ARRAY]; //Things[1];
} THINGSANDFLAGS;
To work with these structures, you often first call the required API to get the size of the data, then allocate a memory block large enough and finally call the same API again so that it can fill the data ...
+5