2021年1月24日星期日

Fortran error when I enter an input - segmentation fault

when I enter the first input I receive this error

Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error:#0 0xffffffff...

here is my code leading up to where the error occurs

program helloworld    implicit none    !gets inputs  character(len = :), allocatable :: point1  real :: pint1V(2)  real :: pint2V(2)  real :: pint3V(2)  character(len = :), allocatable :: point2  character(len = :), allocatable :: point3    !gets lengths  real :: length12  real :: length32  real :: length31  !gets angle of each point  real :: angle1  real :: angle2  real :: angle3       print *, 'input point 1 as "a + bi"'  read *, point1  print *, 'input point 2 as "a + bi"'  read *, point2  print *,'input point 3 as "a + bi"'  read *, point3     
https://stackoverflow.com/questions/65878466/fortran-error-when-i-enter-an-input-segmentation-fault January 25, 2021 at 11:06AM

没有评论:

发表评论