strtoi

Converts an ASCII string to an integer.

Library:LibC
Classification:Other
Service:General C Services

Syntax

  #include <stdlib.h> 
   
  int strtoi (
     const char   *str,   
     int           base);
  

Parameters

str

(IN) Points to the string to convert to an integer.

base

(IN) Specifies the number base of the string.

Return Values

Returns the integer value for the input ASCII string and base.

This value is inaccurate if a value in str is outside the range of the value specified in base. If a character in str is encountered outside the range of base, the function returns the value computed up to that point.

Remarks

The base parameter can be 0, in which case base is given one of the following values:

See Also

atoi