home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 February
/
Chip_2002-02_cd1.bin
/
sharewar
/
apaths
/
APSOURCE.ZIP
/
lstrrchr.c
< prev
next >
Wrap
C/C++ Source or Header
|
2001-03-26
|
941b
|
35 lines
/* lstrrchr - March 26th, 2001
**
** Copyright (c) 1997-2001 by Gregory Braun. All rights reserved.
**
** This function scans a string for the last occurrence of a character.
**
** Called: string = a pointer to the string to search.
** c = the character to scan for.
**
** Returns: A pointer to the last occurrence of c in string,
** or NULL if c is not found.
**
** Notes: This function is provided to eliminate the need for
** linking in the the Standard C Library.
*/
#include "AppPaths.h"
extern LPSTR far lstrrchr (LPSTR string,int c)
{
auto int len = lstrlen (string);
auto int i;
if (!len) return (NULL);
for (i = len - 1; i >= NIL; i--)
if (string[i] == (char) c)
return (&string[i]);
return (NULL);
}
/* end of lstrrchr.c - written by Gregory Braun */