#include stdio.h#include string.hint main () {int len;const char str1[] = ABCDEFG019874;
编程学习网为您整理以下代码实例,主要实现:C语言库strspn()函数,希望可以帮到各位朋友。
#include <stdio.h>
#include <string.h>
int main () {
int len;
const char str1[] = "ABCDEFG019874";
const char str2[] = "ABCD";
len = strspn(str1, str2);
printf("Length of initial segment matching %d\n", len );
return(0);
}