Standard C Functions


atoi


Syntax

#include <stdlib.h>
int atoi(const char *string)
Arguments
string      pointer to the character string

Return Value

A  numerical value of the int type

Description

It converts the character string to a numeric value of the int type by parsing the character string as follows:

[whitespace][{sign}][digits]
<whitespace>
a space, NULL character, or tab character

<sign>
+ or -

<digits>
the decimal characters (more than one digit)

Conversion is terminated when an unrecognizable character appears as part of number.