C Library Functions  - empty (3)

NAME

empty(3f) - [M_anything] set an allocatable array to zero (LICENSE:MIT)

CONTENTS

Synopsis
Description
Example
Author
License

SYNOPSIS

use M_anything, only : empty, assignment(=)

DESCRIPTION

A convenience routine that sets an array to an empty set.

EXAMPLE

Sample program:

   program demo_empty_
   use M_anything, only : empty, assignment(=)
   integer, allocatable      :: ints(:)
   character(:), allocatable :: strs(:)
   real, allocatable      :: reals(:)
      ints=empty
      write(*,*)size(ints)

write(*,*)’give them some size ...’ reals = [1.0,2.0,3.0] ints = [1,2,3] strs = [character(len=10) :: "one","two","three","four"] write(*,*)size(ints) write(*,*)size(reals) write(*,*)size(strs)

ints=empty reals=empty strs=empty write(*,*)’back to empty ...’ write(*,*)size(ints) write(*,*)size(reals) write(*,*)size(strs)

end program demo_empty_

Expected output:

   >             0
   >   give them some size ...
   >             3
   >             3
   >             4
   >   back to empty ...
   >             0
   >             0
   >             0

AUTHOR

John S. Urban

LICENSE

    MIT


Nemo Release 3.1 empty (3) July 22, 2023
Generated by manServer 1.08 from d4dcb4ce-2e44-47dc-bae3-d2cd3c96b985 using man macros.