This is a GCC extension:
int a[100] = {[0 ... 99] = 1};
More Related Contents:
- How to initialize all members of an array to the same value?
- “error: assignment to expression with array type error” when I assign a struct field (C)
- How to initialize array to 0 in C?
- Array Type – Rules for assignment/use as function parameter
- Initializing entire 2D array with one value
- C char array initialization
- No compiler error when fixed size char array is initialized without enough room for null terminator
- c structure array initializing
- In C, why can’t I assign a string to a char array after it’s declared?
- C char array initialization: what happens if there are less characters in the string literal than the array size?
- Declaring and initializing arrays in C
- Assign multiple values to array in C
- Detecting mismatched array enum initializers
- Pointers program
- (Why) is using an uninitialized variable undefined behavior?
- Passing an array as an argument to a function in C
- Why does the indexing start with zero in ‘C’?
- What is the purpose of static keyword in array parameter of function like “char s[static 10]”?
- Is using flexible array members in C bad practice?
- What will be the value of uninitialized variable? [duplicate]
- How to initialize std::array elegantly if T is not default constructible?
- How to use realloc in a function in C
- Dynamically create an array of strings with malloc
- Getting the size of a malloc only with the returned pointer
- Manipulate multidimensional array in a function
- Different way of accessing array elements in C
- Calculate Length of Array in C by Using Function
- Access struct members as if they are a single array?
- Cast T[][] to T*
- Declaring an array of negative length