What is the ...(ellipsis) operator in c?

Viewed 41

I happened to stumble upon the following piece of c code involving a ... operator.

struct sam {
        int b;
        int a;
};

struct sam arr[10] = {
        [0 ... 9] = {.a = 1}
};

It does the work of initializing the a attribute of each struct in the array to 1. What is this operator doing? This is all very new to me, are there any other places where this operator is used?

0 Answers
Related