简体   繁体   中英

What does the “c” in strcspn stand for?

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM