打开已存在的文件时出现分段错误

时间:2019-05-15 01:22:52

标签: fortran fortran95

我正在尝试打开一个已经存在的文件:

    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.

如何打开现有文件并阅读消息?

0 个答案:

没有答案