Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include <string.h> // strlen(), memcmp()
  2.  
  3. int strend(const char *s, const char *t)
  4. {
  5. size_t ls = strlen(s);s
  6. size_t lt = strlen(t);
  7. if (ls >= lt) // check if t can fit in s
  8. {
  9. return (0 == memcmp(t, s + (ls - lt), lt));
  10. }
  11. return 0;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement