书山有径勤为路>>>>>>>>

<<<<<<<<学海无涯苦作舟!

strspn——两个字符串不相同的起始位置


函数名: strspn
功 能: 在串中查找两个字符串不相同的起始位置
用 法: int strspn(char *str1, char *str2);

 

#include<iostream>
#include<cstring>
using namespace std;
int main()
{
char *string1 = "1234567890";
char *string2 = "1234DC8";
int length;
length = strspn(string1, string2);
cout<<"character where strings differ is at position: "<<length<<endl;
return 0;
}

 

 

posted on 2011-11-22 21:41  More study needed.  阅读(304)  评论(0编辑  收藏  举报

导航

书山有径勤为路>>>>>>>>

<<<<<<<<学海无涯苦作舟!