Loading...
Searching...
No Matches
strtol Interface Reference

Definition

Converts a string to integer.

Methods

strtol(character(*) str, (optional) logical success)
Parameters
[in]strString to convert
[out]successOptional flag indicating successful conversion
Returns
Converted integer value
strtol(character(*) str, integer base, (optional) logical success)

Converts a string to integer with explicit base handling. Supports base 2, 8, 10, 16 and prefixes 0x, 0b.

Parameters
[in]strString to convert
[in,out]base0 = auto-detect, otherwise forces given base
[out]successOptional flag indicating successful conversion
Returns
Converted integer value

Examples

The following demonstrate a call to the strtol interface.

integer :: i
logical :: success
i = strtol(' 123', 0, success = res)
! i = 123

Remarks

Definition at line 141 of file token.f90.


The documentation for this interface was generated from the following file: