What is the output of the following C program?
#include <stdio.h>
int main(void) {
int a[] = {[2] = 30, [0] = 10, 20};
printf("%zu %d %d %d\n", sizeof a / sizeof a[0], a[0], a[1], a[2]);
return 0;
}
[2] = 30 sets index 2, [0] = 10 jumps back to index 0, and the plain 20 goes to the next index, 1. The highest index is 2, so there are 3 elements: 10, 20, 30.