6.1.2. Old-style variable initialization
6.1.2 Old-style variable initialization
GNU Fortran allows old-style initialization of variables of the form:
INTEGER i/1/,j/2/ REAL x(2,2) /3*0.,1./
The syntax for the initializers is as for the DATA
statement, but unlike in a DATA
statement, an initializer only applies to the variable immediately preceding the initialization. In other words, something like INTEGER I,J/2,3/
is not valid. This style of initialization is only allowed in declarations without double colons (::
); the double colons were introduced in Fortran 90, which also introduced a standard syntax for initializing variables in type declarations.
Examples of standard-conforming code equivalent to the above example are:
! Fortran 90 INTEGER :: i = 1, j