logo CodeStepByStep logo

overlap

Language/Type: C string return
Related Links:
Author: Cynthia Lee (on 2016/09/29)

Write a function named overlap that accepts two strings (as char*) and returns the number of characters of overlap between the two strings (as an int). The overlap can be at one end ("hello", "lol") or the other ("hello", "Michel"), in the middle ("hello", "ell"), or complete ("hello", "hello"). For examples, the call overlap("hello", "lol") returns 2.

Function: Write a C function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.