#include <stdio.h> int find_char (char **strings,char value) { int num=0; char *string; while((string= *strings++)!=NULL) { while(*string!='\0') { if(*string++==value) { num++; } } } return num; } void main( ) { char *str[100] = { "aaabccdaaa" }; int s_num; s_num=find_char(str,'a'); printf("s_num=%d\r\n",s_num); system("PAUSE"); }
转载于:https://www.cnblogs.com/jaryoung/p/7666196.html