2020-10-31
C语言字符串统计子串数函数
一个计算一个字符串里面子串出现次数的函数 由库函数strstr演变来的
const int* strstrcont(const char* src, const char* sub)
{
const char* bp;
const char* sp;
int count = 0;
if (src == NULL || NULL == sub)//判断src与sub的有效性
{
return count;
}
原创
2020-10-31 17:01:29 ·
211 阅读 ·
0 评论