在 Fortran 95 中编写一个非常简单的读取文件。该文件中只有三个数字,每次我运行代码时,.exe 文件都会显示“ error: attempt to read end-of-file at address
”,任何线索为什么会一直发生这种情况?
代码是:
program readdata
implicit none
!Delcaration of variables
real :: x,y,z
!Main part
open (10, file='C:\Users\matth\OneDrive\Documents\Tutorialcode\array.txt',ACCESS='SEQUENTIAL', STATUS='OLD', FORM='FORMATTED')
read (10, *) x, y, z
print *,x,y,z
close (10)
end program readdata