C++ Programming/Code/Standard C Library/Functions/strstr

strstr
The function strstr returns a pointer to the first occurrence of str2 in str1, or NULL if no match is found. If the length of str2 is zero, then strstr will simply return str1.

For example, the following code checks for FPIFCthe existence of one string within another string: JHJH-C´(J"JC

When run, the above code displays this output:

Found a substring: 'a string of characters'


 * Related topics: memchr - strchr - strcspn - strpbrk - strrchr - strspn - strtok