RosettaCodeData/Task/Singly-linked-list-Element-insertion/Fortran/singly-linked-list-element-insertion.f
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

10 lines
307 B
Forth

elemental subroutine addAfter(nodeBefore,value)
type (node), intent(inout) :: nodeBefore
real, intent(in) :: value
type (node), pointer :: newNode
allocate(newNode)
newNode%data = value
newNode%next => nodeBefore%next
nodeBefore%next => newNode
end subroutine addAfter