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 #1045 background imageLoading...
Page #1045 background image
Appendix A: System Routines — Strings
1003
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
strtok
Declaration:
char *
strtok
(char *
str1
, const char *
str2
)
Category(ies):
Strings
Description:
The
strtok
function considers the string
str1
to consist of a sequence of
zero or more text tokens, separated by spans of one or more characters
from the string
str2
. The first call to
strtok
returns a pointer to the first
token in
str1
and writes a null character into
str1
immediately following the
returned token. Subsequent calls with NULL for the first argument will work
through string
str1
in this way until no tokens remain. The separator string
str2
may be different from call to call.
Inputs:
str1
Character string or NULL.
str2
Character string.
Outputs:
A pointer to the token found in
str1
is returned, NULL if there are no more
tokens.
Assumptions:
str1
points to a character string in RAM.
Side Effects:
None
Availability:
All versions of the TI-89 / TI-92 Plus.
TI-89 / TI-92 Plus
Differences:
None
See Also: strcspn, strspn
Example:
This example creates a string with all of the C "words" from a C program
and pushes it onto the estack.
char cpunct[] = " %,.()!=+-#<>{}*/'[];\n\\\"";
char testIn[] = "short test( char * arg1 ) { return strlen(arg1+1) };";
char testOut[256] = "";
char *token;
token = strtok( testIn, cpunct );
while (token != NULL) {
strcat( testOut, token );
strcat( testOut, " " );
token = strtok( NULL, cpunct );
}
/* Result is "short test char arg1 return strlen arg1 1" */
push_zstr( testOut );

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