Home »
Code Examples »
C Code Examples
C - How to initialize a range of elements to the same value? Code Example
The code for How to initialize a range of elements to the same value?
// To initialize a range of elements to the same value,
// write `[first ... last] = value'.
// This is a GNU extension. For example,
int widths[] = { [0 ... 9] = 1, [10 ... 99] = 2, [100] = 3 };