MEMRCHR - find last occurrence of a character in a string.

(Not in the ANSI standard)

Usage:

#include <sdgstd.h>
ptr = memrchr( s, c, N );

Where:

const void *s;
points to the string to be scanned.
int c;
is the character to look for.
size_t N;
is the length of "s".
void *ptr;
points to the last occurrence of the character in the string. If the character is not found, the NULL pointer is returned.

Description:

"memrchr" returns a pointer to the last occurrence of the character "c" in the first N characters of the string "s".

Unlike "strchr", "memrchr" ignores any '\0' bytes it comes across; thus it does not stop if it finds the end of the string, but keeps on going until it has looked at N characters.

See Also:

expl c lib strchr

expl c lib memchr

Copyright © 1996, Thinkage Ltd.