another substring question from me
sorry for all the questions today but. This is my code:
    
    int overlap(const char *s1, const char *s2){
        int i = 0;
        while (s1[i] && s2[i] && s1[i] == s2[i])
            i++;
        return i;
    }
This returns the length of the substring overlap between the two strings it takes as input. However, if the two strings are:

    abcdefg
    1234efg
it returns an overlap of 0 because it can only read overlaps that start at the beginning of the strings, can someone modify or help me to make it so that it can read overlaps no mantter where they are in the strings?

    
another substring question from me
===

sorry for all the questions today but. This is my code:
    
    int overlap(const char *s1, const char *s2){
        int i = 0;
        while (s1[i] && s2[i] && s1[i] == s2[i])
            i++;
        return i;
    }
This returns the length of the substring overlap between the two strings it takes as input. However, if the two strings are:

    abcdefg
    1234efg
it returns an overlap of 0 because it can only read overlaps that start at the beginning of the strings, can someone modify or help me to make it so that it can read overlaps no mantter where they are in the strings?

    