What does the "c" in strcspn stand for?

Viewed 250

strspn("string", "chars") gives the length of the initial span in string consisting of characters in "chars", while strcspn("string", "chars") gives the length of the initial span in string consisting of characters not in "chars".

What stands the "c" for?

1 Answers

What does the ā€œcā€ in strcspn stand for?

For the word "complementary".

From cppreference strcspn:

The function name stands for "complementary span" because the function searches for characters not found in src, that is the complement of src.

Related