Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(llist), | intent(inout) | :: | lst | |||
character, | intent(in) | :: | data |
subroutine append(lst, data)
type(llist), intent(inout) :: lst
character(*), intent(in) :: data
if (.not. associated(lst%begin)) then
allocate(lst%begin)
lst%begin%data = data
lst%end => lst%begin
else
allocate(lst%end%next)
lst%end%next%data = data
lst%end => lst%end%next
end if
end subroutine append