I'm trying to make a program with N number of arrays that searches matching characters of two strings and then compares the sub string with the rest of the strings. Here's the code:
int main ()
{
int a, b, n;
char sir[50];
printf("Number of strings: "); scanf("%d", &n);
if(n<=1){
printf("The program cannot run without at least 2 strings!");
} else {
printf("The program will run for %d strings.\n", n);
printf("\nString number 1: ");
scanf("%s", &sir);
std::string first(sir);
cout << first;
for(a=2; a<=n; ){
printf("\nString number %d: ", a);
scanf("%s", &sir);
std::string temp(sir);
if(!!!first.contains(temp)!!!){
a++;
} else {
printf("Program stops the substring doesn't match with the last string.");
return 0;
}
}
}
}
Where I put the !!! i don't know how to code that part.