c语言,strcspn,在串中查找第一个给定字符集内容的段

函数名: strcspn
功 能: 在串中查找第一个给定字符集内容的段
用 法: int strcspn(char *str1, char *str2);
程序例:
#include <stdio.h>
#include <string.h>
#include <alloc.h>
int main(void)
{
char *string1 = "1234567890";
char *string2 = "747DC8";
int length;
length = strcspn(string1, string2);
printf("Character where strings intersect is at position %d\n", length);
return 0;
}

posted @ 2013-07-15 20:24  shouqiang Wei  阅读(173)  评论(0编辑  收藏  举报