C语言练习题---指针数组中查找字符

来源:互联网 发布:steam mac中文游戏 编辑:程序博客网 时间:2024/06/08 04:00
#include <stdio.h>#include <string.h>#include <stdlib.h>int find_char(char **, char);int main(void){char *str[3] = {"hello", "world", 0};find_char(str, 'o');return 0;}int find_char(char **strings, char value){char *string = NULL;char str;while( (string = *strings++)!= NULL)while((str = *string++)!= '\0')if(value == str)printf("find it\n");return 0;}

注意:

        *strings++

        *string++

0 0