Texas Instruments TI89 Developer Guide - Page 1039
strcmp, memcmp, maxlen
![]() |
UPC - 033317198566
View all Texas Instruments TI89 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 1039 highlights
Appendix A: System Routines - Strings 997 strncmp Declaration: int strncmp (const char * s1, const char * s2, size_t maxlen) Category(ies): Strings Description: Compare at most maxlen characters (stopping after a null character) of s1 and s2 and return the same result as strcmp. Inputs: s1 - Character string. s2 - Character string. maxlen - Maximum length to search. Outputs: Returns zero if the strings are identical, a positive number if the string pointed to by s1 is greater than the string pointed to by s2, or a negative number if the string pointed to by s1 is less than the string pointed to by s2. If the strings differ, the value of the first nonmatching character in s2 subtracted from the corresponding character in s1 is returned. The subtraction casts the input strings to unsigned chars so that the characters in the range 128 . . . 255 are considered above the characters in the range 0 . . . 127. Assumptions: None Side Effects: None Availability: All versions of the TI-89 / TI-92 Plus. TI-89 / TI-92 Plus Differences: None See Also: strcmp, memcmp Example: If keyName points to a character string that begins with the string "XR_", this example returns a pointer to the string after the "_" character. if (0 == strncmp( keyName, "XR_", 3 )) return keyName + 3; TI-89 / TI-92 Plus Developer Guide Not for Distribution Beta Version January 26, 2001
![](/manual_guide/products/texas-instruments-ti89-developer-guide-95b636f/1039.png)