⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 strcspn.c

📁 Many C samples. It is a good sample for students to learn C language.
💻 C
字号:
/*  File   : strcspn.c
    Author : Richard A. O'Keefe.
    Updated: 11 April 1984
    Defines: strspn()

    strcspn(s1, s2) returns the length  of  the  longest  prefix  of  s1
    consisting  entirely  of  characters  which  are  NOT  in s2 ("c" is
    "complement").  NUL is considered to be part  of  s2.   As  _str2set
    will never include NUL in a set, we have to check for it explicitly.
*/

#include "strings.h"
#include "_str2set.h"

int strcspn(str, set)
    register _char_ *str;
    char *set;
    {
	register int L;

	_str2set(set);
	for (L = 0; *str && _set_vec[*str++] != _set_ctr; L++) ;
	return L;
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -