Will the attempt to read an improper value into a variable change its value?

后端 未结 1 1420
粉色の甜心
粉色の甜心 2021-01-22 00:22

If the iostat keyword is present, a program does not stop if an I/O error occurs. Then, if I try to read an improper value into a scalar variable, i sa

相关标签:
1条回答
  • 2021-01-22 01:06

    No, the value of the variable after an unsuccessful read is undefined.

    Fortran 2008, 9.11.2

    If an error condition occurs during execution of an input/output statement that contains either an ERR= specifier or an IOSTAT= specifier then:

    ...

    if the statement is a READ statement or the error condition occurs in a wait operation for a transfer initiated by a READ statement, all input items or namelist group objects in the statement that initiated the transfer become undefined;

    0 讨论(0)
提交回复
热议问题