logo CodeStepByStep logo

is_suffix

Language/Type: C arrays string
Related Links:
Author: Cynthia Lee (on 2018/02/03)

Write a function named is_suffix that accepts two strings s1 and s2 (as char *), and returns whether s1 ends with all of the characters of s2 in the same order. Return the value 1 to indicate "true" and 0 to indicate "false". For example, the call of is_suffix("sailboat", "boat") should return 1. If s2 is an empty string, you should return 1.

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.