atoi

Converts a string to integer representation

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:String Conversion

Syntax

  #include <stdlib.h>  
   
  int atoi  (  
     const char   *ptr);
  

Parameters

ptr
(IN) Points to the string to be converted.

Return Values

atoi returns the converted value.

Remarks

The atoi function converts the string pointed to by ptr to int representation.

See Also

sscanf, strtoi, strtol

Example

  #include <stdlib.h>  
   
  main ()  
  {  
     int x;  
     x=atoi("-289");  
  }