atoi, atol

Convert strings of ASCII characters to the appropriate numeric values.

Format

#include  <stdlib.h>

int atoi  (const char *nptr);

long int atol  (const char *nptr);

Argument

nptr
A pointer to the character string to be converted to a numeric value.

Description

The atoi and atol functions convert the initial portion of a string to its decimal int or long int value, respectively. The atoi and atol functions do not account for overflows resulting from the conversion. The string to be converted has the following format:
[white-spaces][+|-]digits

The function call atol (str) is equivalent to strtol (str, (char**)NULL, 10), and the function call atoi (str) is equivalent to (int) strtol (str, (char**)NULL, 10), except, in both cases, for the behavior on error.

Return Value
The converted value. 

atoq, atoll (Alpha only)

Convert strings of ASCII characters to the appropriate numeric values. atoll is a synonym for atoq.

Format

#include  <stdlib.h>

__int64 atoq  (const char *nptr);

__int64 atoll  (const char *nptr);

Argument

nptr
A pointer to the character string to be converted to a numeric value.

Description

The atoq (or atoll) function converts the initial portion of a string to its decimal __int64 value. This function does not account for overflows resulting from the conversion. The string to be converted has the following format:
[white-spaces][+|-]digits

The function call atoq (str) is equivalent to strtoq (str, (char**)NULL, 10), except for the behavior on error.

Return Value
The converted value. 


Previous Page | Next Page | Table of Contents | Index