strend, function that checks the occurence of a pattern at the end of a string
I see no point in avoiding the use of Standard Library functions.  Learning to
use them is part of becoming a proficient C programmer.  Hence using strlen
is good and reinventing strcmp or memcmp, as you have done, is bad.  Making the return
value unsigned is just extra typing/noise and achieves nothing.  Here is a
simplified version:

int strend1(const char *str, const char *pattern)
{
    size_t plen = strlen(pattern);
    size_t slen = strlen(str);
    return (plen &lt;= slen) 
           &amp;&amp; !memcmp(pattern, str + slen - plen, plen) ? 1 : 0;
}


Note that the parameters are const.