Chapter-5/5-4/strend.c
/* strend:  returns 1 if the string t
 *  occurs at the end of the string s,and zero otherwise
 */
returns 1 if the string t
occurs at the end of the string s,and zero otherwise
returns 1 if the string t occurs at the end of the string s and zero otherwise
int strEnd(const char *s, const char *t) {
  int ls, lt;
  for (ls = 0; *(s + ls); ls += 1)
    ;
  for (lt = 0; *(t + lt); lt += 1)
    ;
  if (ls >= lt) {
    s += ls - lt;
    while (*s++ == *t++)
      if (!*s) return 1;
  }
  return 0;
}
int strEnd ( const char * s , const char * t ) { int ls , lt ; for ( ls = 0 ; * ( s + ls ) ; ls += 1 ) ; for ( lt = 0 ; * ( t + lt ) ; lt += 1 ) ; if ( ls >= lt ) { s += ls - lt ; while ( * s ++ == * t ++ ) if ( ! * s ) return 1 ; } return 0 ; }
strend:  returns 1 if the string t
  occurs at the end of the string s,and zero otherwise
strend : returns 1 if the string t occurs at the end of the string s and zero otherwise