Given that the Visual C++ compiler, when dealing with C code, doesn't have support for C99 array initialisation designators, does anybody have any clever ideas for initialising a sparsely-populated array?
What I'm talking about is the inability to do this:
static const int foo[256] = {
[64] = 12345,
[120] = 9876,
// etc...
};
I have a read-only lookup table 256-element array that will be static const, but a significant proportion of the indices will not be populated. I was just going to include an appropriate number of dummy entries in the initialisation statement, but maybe there's a better way.
P.S. Dear Microsoft, it's been 20 years, and your compiler still doesn't support a useful standard language feature, despite you going to the trouble of adding features from later standards, like C17. Please add full C99 support. Thank you.