Ejemplo n.º 1
0
int main()
{
    char *string = "beat";
    char *sub = "bat";

    printf("%d\n", hasSubstring(string, sub));

    return 0;
}
Ejemplo n.º 2
0
int main ()
{
   char word[10], substring[10];

   printf("Word: ");
   scanf("%s", word);
   printf("Substring to search for: ");
   scanf("%s", substring);

   if (hasSubstring(word, substring))
   {
      printf("%s contains the substring %s.\n", word, substring);
   }
   else
   {
      printf("%s does NOT contain the substring %s.\n", word, substring);
   }

   return 0;
}