EasyManuals Logo

Texas Instruments TI-89 Developer's Guide

Texas Instruments TI-89
1398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1153 background imageLoading...
Page #1153 background image
Appendix A: System Routines — Utilities
1111
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
strtol
Declaration:
long
strtol
(const char *
str
, char **
end_ptr
, int
base
)
Category(ies):
Utilities, Strings
Description:
Converts the initial portion of the string pointed to by
str
into a long int, and
if
end_ptr
is not a null pointer, sets the character pointer pointed to by
end_ptr
to the address of the first character following the set of characters
converted. The function skips leading whitespace, accepts an optional sign
character (+ or -), then scans a sequence of alphanumeric characters
matching some integer represented in a base determined from the value of
base
.
If the value of
base
is zero, the conversion base is determined by the initial
characters in the alphanumeric sequence. If the first character is 0 and the
second character is x or X, hexadecimal conversion is performed. If the first
character is 0 and the second character is not x or X, octal conversion is
performed. Otherwise, decimal conversion is performed.
If the value of
base
is between 2 and 36, a sequence of letters and digits
representing an integer of the indicated base is accepted. The letters a
through z (or A through Z) represent the values 10 through 35. Only letters
and digits with values less than the value of
base
are converted. If the
value of
base
is 16 the sequence 0 followed by x or X may optionally
precede the alphanumeric sequence.
Conversion of the string continues until a character is encountered that is
not a digit in the indicated base. If
end_ptr
is not a null pointer, the object it
points to is assigned a pointer to this first unconverted character.
Inputs:
str
String to convert.
end_ptr
Points to a character pointer that will contain the address of
the first character following the set of characters converted
when the function returns (or null).
base
Conversion base.
Outputs:
Returns the converted long int value. If no conversion can be performed,
zero is returned. If the conversion results in an overflow,
errno
is set to
ERANGE. In this case,
strtol
returns LONG_MAX or LONG_MIN
depending on the sign of the result. If the value of
base
is neither 0 nor in
the range 2 to 36, the object pointed to by
end_ptr
is set to
str
, 0 is
returned, and
errno
is set to EDOM.
(continued)

Table of Contents

Other manuals for Texas Instruments TI-89

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TI-89 and is the answer not in the manual?

Texas Instruments TI-89 Specifications

General IconGeneral
Display size (HxV)100 x 160 mm
Memory type639K FLASH ROM, 188K bytes RAM
Compatible operating systemsOperating System 2.09
Battery typeAAA

Related product manuals