在一个字符串中搜索某个特定的字符值

    xiaoxiao2021-03-26  57

    //在一些字符串中搜索某个特定的字符值 int FindString(char **strings, char value)//strings是一个指向指针数组的指针,value是我们所查找的字符值 { assert(strings != NULL); char *string;//我们当前正在查找的字符串 while ((string=*strings++)!=NULL)//对于列表中的每个字符串 { //观察字符串中的每个字符,看看是不是我们想要查找的那个 while (string++!=‘\0’) { if (*string++ ==value) return 1; } } return 0; }
    转载请注明原文地址: https://ju.6miu.com/read-659407.html

    最新回复(0)