home *** CD-ROM | disk | FTP | other *** search
- /*********
- * _TR_ATLAST
- * by Leonard Zerman
- * Placed in the public domain by Tom Rettig Associates, 10/22/1990.
- *
- * Syntax: _tr_atlast( <*C>, <*C> )
- * Return: The last position of a character found in a string.
- * Note : Returns 0 if not found, -1 if error.
- ********/
-
- #include "trlib.h"
-
- _tr_atlast(c,instr) /* declare the atlast function */
- char *instr; /* pointer to the passed string */
- char *c; /* pointer to the char to be found */
- {
- int i;
-
- for (i = _tr_strlen(instr); instr[i] != *c && i >= 0 ; i--)
- ; /* empty loop checking for condition */
- return( ++i );
- }
- /* eof */
-
-