Strrchr - Texas Instruments TI-89 Developer's Manual

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

1000

strrchr

Declaration:
char * strrchr (const char * str , int c );
Category(ies):
Strings
Description:
Locates the last occurrence of the character c in the string pointed to by
str .
str — Pointer to character string.
Inputs:
c
Returns a pointer to the located character, or a null pointer if c is not found
Outputs:
in str .
Assumptions:
None
Side Effects:
None
Availability:
All versions of the TI-89 / TI-92 Plus.
TI-89 / TI-92 Plus
Differences:
None
See Also:
strchr, strcspn, strspn, strstr, strpbrk, memchr
Example:
BOOL findlastchar( const char *str1, int ch, char *buf )
/* findlastchar - Return TRUE if found ch in str1 and build message in buf
indicating the last occurrence, else return FALSE.
*/
{
char *ptr;
if( ( ptr = strrchr(str1, ch)) == NULL )
return( FALSE );
sprintf( buf, "Last '%c' is found at position %d in string: %s\n",
ch, (ptr - str1 + 1), str1);
return( TRUE );
}
TI-89 / TI-92 Plus Developer Guide
— Character to search for.
/* ch not found in str1 */
Not for Distribution
Appendix A: System Routines — Strings
Beta Version January 26, 2001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents