Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h> // strlen(), memcmp()
- int strend(const char *s, const char *t)
- {
- size_t ls = strlen(s);s
- size_t lt = strlen(t);
- if (ls >= lt) // check if t can fit in s
- {
- return (0 == memcmp(t, s + (ls - lt), lt));
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement