Files
Victor Eijkhout b13edff125 initial upload
2022-11-13 14:03:01 -06:00

30 lines
643 B
Fortran

!****************************************************************
!***
!*** This file belongs with the course
!*** Introduction to Scientific Programming in C++/Fortran2003
!*** copyright 2017-2020 Victor Eijkhout eijkhout@tacc.utexas.edu
!***
!*** assignwrong.F90 : pointer copying done wrong
!***
!*** THIS CODE IS WRONG: IT ILLUSTRATES A COMMON CODING ERROR !!!!
!***
!****************************************************************
Program AssignPointer
implicit none
!!codesnippet passignwrong
real,target :: x
real,pointer :: p1,p2
x = 1.2
p1 => x
p2 = p1
print *,p2
!!codesnippet end
End Program AssignPointer