I can find a substring with using strstr
function. For example I can find "Hello" substring, but I want to find "Hello" and "welcome". Not only one of them I want to find both of them. I want to think about "hello" and "welcome" like they are the same word. If the program can find the world "hello" it returns false, if the program can find the world "welcome" it returns false but if the program can find the words "hello" and "welcome" it returns true. how can I do that?
int main(){
int total=0;
char *p="Hello world welcome!";
while ( strstr(p,"Hello") != NULL ) {
printf("%s", p); // to know the content of p
p++;
total++;
}
printf("%i", total);
getch(); // pause
}