Array Constants

Fortran includes the concept of an array constant. This can reduce the size of a program if an array must be initialized to a set of constant values.

list = (/ 2, 4, 10 /)
        

Same as

list(1) = 2
list(2) = 4
list(3) = 10
        

C does not have the same flexible array constant construct, but it does allow array initializers. In addition, when an initializer is used on an array, we can omit the array size, since it can be inferred from the initializer.

double  list[] = { 2, 4, 10 };