find one string inside another
#include <string.h> char *strstr( const char *str, const char *substr ); char __far *_fstrstr( const char __far *str, const char __far *substr );
The strstr() and _fstrstr() functions locate the first occurrence in the string pointed to by str of the sequence of characters (excluding the terminating null character) in the string pointed to by substr.
The _fstrstr() function is a data-model-independent form of the strstr() function. It accepts far pointer arguments, and returns a far pointer. It is most useful in mixed memory model applications.
a pointer to the located string, or NULL if the string is not found
#include <stdio.h> #include <string.h> void main() { printf( "%s\n", strstr("This is an example", "is") ); }
produces the output:
is is an example