#include <stdio.h>
#include <string.h>
int contain( int argc, char* argv[])
{
int i;
int j;
int lenst1;
int lenst2;
int pos1;
int pos2;
if (lenst2>lenst1)
{
printf("flase");
return 0;
}
for (j=0; j<lenst1;j++)
{
for (i=0; i<lenst2; i++)
{
if (st2[i]==st1[j])
{
pos1=j;
pos2=i;
while (pos2<lenst2)
{
pos2++;
pos1++;
if (st2[i]==st1[j])
{
}
else
{
printf("flase\n");
return 0;
}
printf("true\n");
return 0;
}
}
}
}
}
My goal is to write a program called "contains" that takes two text strings as arguments and prints "true" followed by a newline.
If the second string is entirely contained within the first, or "false" followed by a newline otherwise. I think my logic is correct. My question is how do I pass these two strings as parameters.