index VS strchr

index系列函数和strchr系列函数
都是用来 查找字符串中出现的指定一个字符
连它们的声明也几乎一样

        #include <strings.h>

        char *index(const char *s, int c);

        char *rindex(const char *s, int c);

        #include <string.h>

        char *strchr(const char *s, int c);

        char *strrchr(const char *s, int c);

不过它们主要的不同在index和rindex函数的说明中:
        The terminating NULL character is considered to be a part of the strings.

也就是说index系列函数把字符串中最后的结束字符也当是字符串的内容处理也就是你可以这样
index(str,'\0')和rindex(str,'\0')而strchr系列函数就不可以了