atol

Converts a string to long integer representation

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

Syntax

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

Parameters

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

Return Values

atol returns the converted value.

Remarks

The atol function converts the string pointed to by ptr to long integer representation.

See Also

sscanf, strtol

Example

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