strtoimax


strtoimax

Converts a string into an integer value with type intmax_t

 #include <inttypes.h> intmax_t strtoimax ( const char * restrict s , char ** restrict endptr ,                     int base  ); 

The strtoimax( ) function is similar to strtol( ), except that it converts a string to an integer value of type intmax_t. If the conversion fails, strtoimax( ) returns 0. If the result of the conversion exceeds the range of the type intmax_t, then strtoimax( ) returns the value of INTMAX_MAX or INTMAX_MIN, and sets the errno variable to the value of ERANGE ("range error").

Example

See the example for the analogous function strtol( ) in this chapter.

See Also

strtoumax( ), wcstoimax( ), and wcstoumax( ); strtol( ) and strtoul( ); strtod( ), strtof( ), and strtold( ); wcstol( ) and wcstoul( )



C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net