[an error occurred while processing this directive]
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

atoi

Syntax

 
#include <stdlib.h>

int atoi(const char *string);

Description

Convert as much of the string as possible to an equivalent integer value.

This function is almost like (int)strtol(string, NULL, 10) (see section strtol).

Return Value

The equivalent value, or zero if the string does not represent a number.

Portability

ANSI/ISO C C89; C99
POSIX 1003.2-1992; 1003.1-2001

Example

 
main(int argc, char **argv)
{
  int i = atoi(argv[1]);
  ...

[an error occurred while processing this directive]