分享一个大牛的人工智能教程。零基础!通俗易懂!风趣幽默!希望你也加入到人工智能的队伍中来!请点击http://www.captainbed.net
/*
* StrEnd: Return 1 if the string t occurs at the end of the string s,
* and zero otherwise.
*
* StrEnd.c - by FreeMan
*/
int StrLen(const char *s)
{
char *p = s;
while (*p != '\0')
{
p++;
}
return p - s;
}
int StrEnd(const char *s, const char *t)
{
s += StrLen(s) - StrLen(t);
while (*s && *s++ == *t++);
return !*s;
}