In C, the STRCHR and STRSTR functions are included in the <string.h> header file, which is to include the <string.h> header file in front of the program to invoke them, that is, to write this statement: #include < String.h>
STRCHR function prototype: char * STRCHR (char * str, int ch); The function is to find out the position of the character ch for the first time in string str, and find a pointer that returns the character position ( That is, returns the position of the character's address in the string, and returns an empty pointer (or null) if it is not found.
strstr function Prototype: char * STRSTR (char * str1,char * str2); The function is to find out the position of the string str1 for the first time in the string str2 (that is, the string SR1 contains the string str2). Finds a pointer that returns the position of the string (that is, the position of the address that returns the string str2 in the string str1), and returns a null pointer (that is, null) if it is not found.
one is to find the position of one character in a string, and the other to find the position of a string within another string.
These are all in the last of C language books, you have to learn to read more books, to solve their own problems. Learn to program is to have patience, learn a long time will understand.