Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(int argc, char *argv[])
- {
- int i;
- int v[10] = { [0 ... 3] = 2, [4 ... 8] = 4, [9] = 6 };
- for(i = 0; i < sizeof(v) / sizeof(*v); i++)
- printf("v[%d]: %d\n", i, v[i]);
- return 0;
- }
- /*
- v[0]: 2
- v[1]: 2
- v[2]: 2
- v[3]: 2
- v[4]: 4
- v[5]: 4
- v[6]: 4
- v[7]: 4
- v[8]: 4
- v[9]: 6
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement