static uint8_t togglecode[256] = {
[0x3A] CAPSLOCK,
[0x45] NUMLOCK,
[0x46] SCROLLLOCK
};
What\'s the meaning of [0x3A]
her
According to the GCC docs this is ISO C99 compliant. They refer to it as "Designated Initialzers":
To specify an array index, write `[index] =' before the element value. For example,
int a[6] = { [4] = 29, [2] = 15 };
is equivalent to
int a[6] = { 0, 0, 15, 0, 29, 0 };
I've never seen this syntax before, but I just compiled it with gcc 4.4.5, with -Wall. It compiled successfully and gave no warnings.
As you can see from that example, it allows you to initialize specific array elements, leaving the others untouched.