| Summary |
#include <string.h>
int fstrpos (
const char far *string, /* string to search */
char c); /* character to find */
|
| Description | The fstrpos function searches string for the first 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 fstrpos function returns the index of the 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. |
| See Also | fstrcat, fstrchr, fstrcmp, fstrcpy, fstrcspn, fstrlen, fstrncat, fstrncmp, fstrncpy, fstrpbrk, fstrrchr, fstrrpbrk, fstrrpos, fstrspn |
| Example |
#include <string.h>
#include <stdio.h> /* for printf */
void tst_strpos (char far *text) {
int i;
i = fstrpos (text, ' ');
if (i == -1)
printf ("No spaces found in text.\n");
else
printf ("Found a space at offset %d\n", i);
}
|