資源簡介
C++實現字符串匹配函數,匹配中可以包括通配符
代碼片段和文件信息
/**
??*?Function:?wildcmp
??*?Description:?wildcard?match
??*?Input:
??*?Output:
??*?Return:
??*?Others:
??*/
int?wildcmp(const?char?*wild?const?char?*string)
{
????const?char*?cp?=?NULL;
const?char*?mp?=?NULL;
//此循環匹配
????while?((*string)?&&?(*wild?!=?‘*‘))?
{
????????if?((*wild?!=?*string)?&&?(*wild?!=?‘?‘))
{
????????????return?0;
????????}
????????wild++;
????????string++;
????}
????while?(*string)
{
????????
- 上一篇:通用紅黑樹Tree-Map容器純C實現
- 下一篇:c++深度優先搜索實現矩陣互斥問題
評論
共有 條評論