gpt4 book ai didi

c - strpbrk 代表什么?

转载 作者:太空狗 更新时间:2023-10-29 16:23:39 24 4
gpt4 key购买 nike

我用过 strpbrk()偶尔在 C 中做低级字符串工作时,但我一直无法弄清楚它代表什么。我一直在脑海中将其发音为“stir p bark”,但我从来没有觉得这很对。

它没有像任何其他字符串函数那样明显的词源,例如strchr(string character)或 strspn( string span).

我依稀记得在某处读到所有原始标准库函数都被限制为 7 个字符的名称,要么是为了与 Fortran 兼容,要么是因为在原始 C 标准中,长度超过 7 个字符的标识符被认为等同于它们的 7-字符前缀什么的。任何人都可以确认/否认/澄清这一点吗?

最佳答案

下面的对话暗示了“String Pointer Break”: http://www.cpptalk.net/what-strspn-and-strpbrk-stands-for--vt1253.html

事实上,Microsoft 文文件例是 StrPBrk 并且倾向于确认单词拆分: http://msdn.microsoft.com/en-us/library/bb760010(VS.85).aspx

最后这证实了这一点: http://www.gnu.org/software/libtool/manual/libc/Search-Functions.html

The strpbrk (“string pointer break”) function is related to strcspn, except that it returns a pointer to the first character in string that is a member of the set stopset instead of the length of the initial substring. It returns a null pointer if no such character from stopset is found.

关于c - strpbrk 代表什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/500994/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com