Clicky

Fortran Wiki
iso_c_binding (changes)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Showing changes from revision #2 to #3: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

Description

iso_c_binding is a standard intrinsic module which defines named constants, types, and procedures for C interoperability.

Standard

Fortran 2003 and later

Intrinsic Procedures

The following intrinsic procedures are provided by the module; their definition can be found in the section Intrinsic Procedures of this manual.

Named Constants

The iso_c_binding module also provides the following named constants of type default integer, which can be used as kind type parameters.

Fortran TypeNamed constantC typeNote
integerc_intint
integerc_shortshort int
integerc_longlong int
integerc_long_longlong long int
integerc_signed_charsigned char/unsigned char
integerc_size_tsize_t
integerc_int8_tint8_t
integerc_int16_tint16_t
integerc_int32_tint32_t
integerc_int64_tint64_t
integerc_int_least8_tint_least8_t
integerc_int_least16_tint_least16_t
integerc_int_least32_tint_least32_t
integerc_int_least64_tint_least64_t
integerc_int_fast8_tint_fast8_t
integerc_int_fast16_tint_fast16_t
integerc_int_fast32_tint_fast32_t
integerc_int_fast64_tint_fast64_t
integerc_intmax_tintmax_t
integerc_intptr_tintptr_t
integerc_ptrdiff_tintptr_tTS 29113
realc_floatfloat
realc_doubledouble
realc_long_doublelong double
complexc_float_complexfloat _Complex
complexc_double_complexdouble _Complex
complexc_long_double_complexlong double _Complex
logicalc_bool_Bool
characterc_charchar

Additionally, the following parameters of type character(kind=c_char) are defined.

(削除)
(削除ここまで)
(追記)
NameC definitionValue
c_null_charnull character'0円'
c_alertalert'\a'
c_backspacebackspace'\b'
c_form_feedform feed'\f'
c_new_linenew line'\'
c_carriage_returncarriage return'\r'
c_horizontal_tabhorizontal tab'\t'
c_vertical_tabvertical tab'\v'
(追記ここまで)
(削除)

| c_carriage_return | carriage return | '\\r' | | c_horizontal_tab | horizontal tab | '\\t' | | c_vertical_tab | vertical tab | '\\v' |

(削除ここまで)
(削除) (削除ここまで)

Moreover, the following two named constants are defined:

NameType
c_null_ptrc_ptr
c_null_funptrc_funptr

Both are equivalent to the value NULL in C.

Revised on March 2, 2023 16:43:18 by vmagnin (86.67.213.94) (4132 characters / 1.0 pages)
Edit | Back in time (2 revisions) | Hide changes | History | Views: Print | TeX | Source | Linked from: Code, Fortran 2008, c_associated, c_f_pointer, c_f_procpointer, c_funloc, c_loc, c_sizeof, 2009, C interoperability, Generating C Interfaces

AltStyle によって変換されたページ (->オリジナル) /