#include <stdio.h>
#include <string.h>
int main(void)
{
char sentence[50] = "Linux c programming";
char word[20] = "Linux";
if (strstr(sentence, word) != NULL)
printf("Found\n"); // Found
else
printf("NOT Found\n");
if (strstr(sentence, "linux") != NULL)
printf("Found\n");
else
printf("NOT Found\n"); // NOT Found
// find also a part of the word
if (strstr(sentence, "Lin") != NULL)
printf("Found\n"); // Found
else
printf("NOT Found\n");
return 0;
}
/*
run:
Found
NOT Found
Found
*/