logo CodeStepByStep logo

overlap

Language/Type: C strings return
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.

Type your solution here:


This is a function problem. Write a C function as described. Do not write a complete program; just the function(s) above.

You must log in before you can solve this problem.


Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.

© Marty Stepp, all rights reserved.