<< Previous | Next >>

strstr

NEAR SYNTAX: char * _n_strstr( char *s1, char *s2 );

FAR SYNTAX: char far * _f_strstr( char far * s1, char far * s2 );

NOTE By default, strstr() is defined to _n_strstr().

Description

Finds a substring specified by s2 in string s1.

For Rabbit 4000+ users, this function supports FAR pointers. By default the near version of the function is called. The macro USE_FAR_STRING will change all calls to functions in this library to their far versions. The user may also explicitly call the far version with _f_strfunc where strfunc is the name of the string function.

Because FAR addresses are larger, the far versions of this function will run slightly slower than the near version. To explicitly call the near version when the USE_FAR_STRING macro is defined and all pointers are near pointers, append _n_ to the function name, e.g., _n_strfunc. For more information about FAR pointers, see the Dynamic C User's Manual or the samples in Samples/Rabbit4000/FAR/.

Parameters

s1
String to be scanned.

s2
Substring to search for.

Return value

Pointer to the first occurrence of substring s2 in s1. Returns null if s2 is not found in s1.

Library

STRING.LIB

See also

strcspn, strrchr, strtok


Dynamic C Functions << Previous | Next >> rabbit.com