#include <string.h>
int fstrrpos (
const char far *string, /* string to search */
char c); /* character to find */
Description
The fstrrpos function searches string
for the last occurrence of c. The null character
terminating string is included in the search.
Note
This function uses far
pointers to objects and may be used in any memory model other than
Tiny Model.
Return Value
The fstrrpos function returns the index of the last
character matching c in string
or a value of -1 if no matching character was found. The index of the
first character in string is 0.
#include <string.h>
#include <stdio.h> /* for printf */
void tst_strrpos (char far *s) {
int i;
i = fstrrpos (s, ' ');
if (i == -1)
printf ("No spaces found in %s\n", s);
else
printf ("Last space in %s is at offset %d\n", s, i);
}
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.