Skip to main content

Fortran pointer

Lilya 黑静美...Less than 1 minuteProgrammierungSyntaxmarkdown

Fortran pointer

program pointerExample
implicit none

   integer, pointer :: p1
   integer, target :: t1 
   
   p1=>t1
   p1 = 1
   
   Print *, p1
   Print *, t1
   
   p1 = p1 + 4
   
   Print *, p1
   Print *, t1
   
   t1 = 8
   
   Print *, p1
   Print *, t1
   
end program pointerExample
Comments
  • Latest
  • Oldest
  • Hottest
Powered by Waline v3.1.3