program main implicit none integer, pointer :: p(:) integer, target, allocatable :: x(:) allocate (x(3)) x = (/ 1, 2, 3 /) p => x deallocate (x) print *, p ! 解放されたメモリ領域を参照している。 end program