atoi()

convert a string to an integer 

Function


SYNOPSIS

#include <stdlib.h>

int atoi(const char *nptr);


DESCRIPTION

Converts a string representing an integer to an integer. The string to be converted consists of optional leading white space, an optional sign and a series of contiguous digits.

The call atoi(nptr) is equivalent to:

(int) strtol(nptr,(char **)NULL, 10)

PARAMETERS

nptr 

Points to a string to be converted to an integer.


RETURN VALUES

The atoi() function returns the converted integer value.

If the converted value overflows, LONG_MIN or LONG_MAX is returned (according to the sign of the value) and errno is set to ERANGE. If no character could be converted, zero is returned.


CONFORMANCE

ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
atol(), strtol()


PTC MKS Toolkit 10.1 Documentation Build 15.