hi everyone i need some help i have this program in this i have two strings string s and string t. and after taking input from user i compare that string t contained in string s or not if it contained then its ok but if the first character of string t is not contained in string s then i have to remove the first character of string t and then again compare it anyone can tell me that how i will do that easily.
This doesn't "remove" the offending character, but leaves str2 pointing to the first character in the original str2 contained in str1. You have to be more specific if you want a better answer.
1 2 3 4 5 6
char *end = str2 + strlen(str2);
for ( ; str2 != end; str2++)
{
if (strstr(str1, str2))
break;
}