strrchr 字符在字符串中最后一次出现的位置

;***
;char *strrchr(string, ch) - find last occurrence of ch in string
;
;Purpose:
;       Finds the last occurrence of ch in string.  The terminating
;       null character is used as part of the search.
;
;       Algorithm:
;       char *
;       strrchr (string, ch)
;             char *string, ch;
;             {
;             char *start = string;
;
;             while (*string++)
;                     ;
;             while (--string != start && *string != ch)
;                     ;
;             if (*string == ch)
;                     return(string);
;             return(NULL);
;             }
;
;Entry:
;       char *string - string to search in
;       char ch - character to search for
;
;Exit:
;       returns a pointer to the last occurrence of ch in the given
;       string
;       returns NULL if ch does not occurr in the string
;
;Uses:
;
;Exceptions:
;
;*******************************************************************************
posted @ 2012-12-05 20:23  helloweworld  阅读(513)  评论(0编辑  收藏  举报