我正在尝试打开一个已经存在的文件:
program writeeven
implicit none
logical :: alive
inquire(file='even.txt', exist=alive)
if (alive) then
print *, 'file is existed'
open(12, file='even.txt')
else
print *, 'file is not existed'
end if
end program writeeven
程序给出以下消息:
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
如何打开现有文件并阅读消息?