Texas Instruments TI89 Developer Guide - Page 1045
strcspn, immediately following
![]() |
UPC - 033317198566
View all Texas Instruments TI89 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 1045 highlights
Appendix A: System Routines - Strings 1003 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 ); TI-89 / TI-92 Plus Developer Guide Not for Distribution Beta Version January 26, 2001
![](/manual_guide/products/texas-instruments-ti89-developer-guide-95b636f/1045.png)