[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


strtoll

Character array conversion to integer value of type long long int.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
unsigned long int strtoul(const char *nptr,
  char **endptr, int base);
Parameters:

Parameters for this facility are:

nptr  
const char *  
A Null terminated array to convert  
endptr  
char **  
A pointer to a position in nptry that is not convertible.  
base  
int  
A numeric base between 2 and 36  

Remarks:

The strtoll() function converts a character array, pointed to by nptr, expected to represent an integer expressed in radix base to an integer value of type long long int. A plus or minus sign (+ or -) prefixing the number string is optional.

The base argument in strtoll() specifies the base used for conversion. It must have a value between 2 and 36, or 0. If base is 0, then strtoll() converts the character array based on its format. Character arrays beginning with'0' are assumed to be octal, number strings beginning with'0x' or'0X' are assumed to be hexadecimal. All other number strings are assumed to be decimal.

If the endptr argument is not a null pointer, it is assigned a pointer to a position within the character array pointed to by nptr. This position marks the first character that is not convertible to a long int value.

This function skips leading white space.

This function sets the global variable errno to ERANGE if there is a conversion error.

Return:

strtoll() returns an unsigned integer value of type long long int. If the converted value is less than LLONG_MIN, strtoll() returns LLONG_MIN and sets errno to ERANGE. If the converted value is greater than LLONG_MAX, strtoll() returns LLONG_MAX and sets errno to ERANGE. The LLONG_MIN and LLONG_MAX macros are defined in limits.h

See Also:

"strtod"

"strtol"

"errno"

"Integral type limits"

"Overview of math.h"

For example of strtoll() usage:
Refer to "Example of strtol(), strtoul(), strtoll(), and strtoull() usage".


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000