C语言之strpbrk函数
来源:互联网 发布:新奔腾计价软件 编辑:程序博客网 时间:2024/06/06 12:41
该函数的头文件为#include <string.h>,其作用是比较字符串str1和str2中是否有相同的字符,如果有,则返回该字符在str1中的最先出现的位置的指针。
其函数原型如下:
char
*
strpbrk
(
const
char
*str1,
const
char
*str2)
{
const
char
*p1 = NULL;
const char *p2 = NULL;
for
(p1 = str1;*p1 !=
'\0'
; ++p1)
{
for
(p2 = str2;*p2 !=
'\0'
; ++p2)
{
if
(*p1 == *p2)
{
return
(
char
*)p1;
}
}
}
return
NULL;
}
阅读全文
0 0
- C语言之strpbrk函数
- C语言之strpbrk函数
- C语言字符串函数-strpbrk函数
- 详解C语言中strpbrk()函数的用法
- C语言str系列库函数之strspn()、strcspn()和strpbrk()
- strpbrk ( )【C语言库函数源代码】
- C语言strpbrk()函数:返回两个字符串中首个相同字符的位置
- strpbrk函数
- strpbrk() 函数
- strpbrk() 函数
- strpbrk() 函数
- strpbrk函数
- strpbrk函数
- strpbrk函数
- strpbrk函数
- strpbrk函数
- strpbrk函数
- strpbrk函数
- Mybatis逆向工程及mysql jar not find
- Source Insight添加.cc文件
- JavaScriptDOM对象控制HTML元素
- 【VS2010]新人求教如何删除【附加依赖项】中“继承的值”?
- 快速幂+组合数
- C语言之strpbrk函数
- 关于实习公司及简历投递的选择
- java集合
- 限定EditText小数位数
- java 加密指定位数字符串
- pow函数
- caffe 中classification.cpp的源码详解、改写
- jQuery方法原生js实现 --- siblings兄弟节点
- Java游戏:FlappyBird源代码