strpbrk——在串中查找第一个在给定串中出现的字符
函数名: strpbrk
功 能: 在串中查找第一个在给定串中出现的字符
用 法: char *strpbrk(char *str1, char *str2);
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
char *string1 = "abcdefghijklmnopqrstuvwxyz";
char *string2 = "omn";
char *ptr;
ptr = strpbrk(string1, string2);
if(ptr)
cout<<"strpbrk found first character:"<<*ptr<<endl;
else
cout<<"strpbrk didn't find character:"<<endl;
return 0;
}
posted on 2011-11-22 21:37 More study needed. 阅读(246) 评论(0) 编辑 收藏 举报