Appendix A: System Routines — Strings
strcmp
Declaration:
int strcmp (const char * s1 , const char * s2 )
Category(ies):
Strings
Description:
Lexicographically compares two strings.
Inputs:
s1 — Character string.
s2 — Character string.
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.
Assumptions:
None
Side Effects:
None
Availability:
All versions of the TI-89 / TI-92 Plus.
TI-89 / TI-92 Plus
Differences:
None
See Also:
strncmp, memcmp
Example:
BOOL isSolverVar( char *str )
/* Return TRUE if string str is one of the solver variables
else return FALSE.
*/
{
char eqnstr[] = "eqn";
char expstr[] = "exp";
if( (strcmp( str, eqnstr) == 0) || (strcmp( str, expstr) == 0) )
return TRUE;
return FALSE;
}
TI-89 / TI-92 Plus Developer Guide
Not for Distribution
991
Beta Version January 26, 2001