Strchr - Texas Instruments TI-89 Developer's Manual

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

Advertisement

990

strchr

Declaration:
char * strchr (const char * str , int c )
Category(ies):
Strings
Description:
Locates the first occurrence of the character c in the string pointed to by
str . The character c may be any character including the null character (\0).
str — Character string to search.
Inputs:
c
Returns a pointer to the first occurrence of c in str . If c is not in str , strchr
Outputs:
returns a null pointer.
Assumptions:
None
Side Effects:
None
Availability:
All versions of the TI-89 / TI-92 Plus.
TI-89 / TI-92 Plus
Differences:
None
See Also:
strrchr, memchr, strspn, strcspn, strpbrk, strstr
Example:
short KeyYesOrNo( WORD Key )
/* If Key is ENTER or is an alpha and in XR_YesStr return TRUE,
if it is ESC or is an alpha and in XR_NoStr return FALSE,
otherwise return -1.
*/
{
if (Key == KB_ENTER)
return TRUE;
if (Key == KB_ESC)
return FALSE;
if (Key <= 0xFF) {
if (strchr(XR_stringPtr(XR_YesStr), (BYTE) Key ))
return TRUE;
if (strchr(XR_stringPtr(XR_NoStr), (BYTE) Key ))
return FALSE;
}
return -1;
}
TI-89 / TI-92 Plus Developer Guide
— Character to locate.
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