2 ! Support F2008's c_sizeof()
4 use iso_c_binding
, only
: c_int
, c_char
, c_ptr
, c_intptr_t
, c_null_ptr
, c_sizeof
6 integer(kind
=c_int
) :: i
, j(10)
7 character(kind
=c_char
,len
=4),parameter :: str(1 ) = "abcd"
8 character(kind
=c_char
,len
=1),parameter :: str2(4) = ["a","b","c","d"]
10 integer(c_intptr_t
) :: iptr
12 ! Using F2008's C_SIZEOF
25 write(*,*) c_sizeof(cptr
), c_sizeof(iptr
), c_sizeof(C_NULL_PTR
)
40 i
= sizeof(str(1)(1:3))