program main
  implicit none
  character(6) , pointer :: str_src
  character(10), pointer :: str_dst
  integer :: i

  allocate(str_src, &
           str_dst)

  str_src = 'hoge'
  str_dst = ''
  call copy_string(str_src, str_dst)

  print*, 'Fortran program'
  print*, 'str_src: ', str_src, ', len_trim(str_src):', len_trim(str_src)
  print*, 'str_dst: ', str_dst, ', len_trim(str_dst):', len_trim(str_dst)

  print*, 'str_src:'
  do i = 1, len(str_src)
    print"(i2,1x,b8.8,1x,a)", i, str_src(i:i), str_src(i:i)
  enddo

  print*, 'str_dst:'
  do i = 1, len(str_dst)
    print"(i2,1x,b8.8,1x,a)", i, str_dst(i:i), str_dst(i:i)
  enddo
end program main