gpt4 book ai didi

c - 为什么没有 strnchr 函数?

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

作为其他C库函数,如strcpystrcat,有一个版本限制了字符串的大小(strncpy等) .),我想知道为什么 strchr 没有这样的变体?

最佳答案

它确实存在——它叫做memchr:

http://en.wikipedia.org/wiki/C_string_handling

关于c - 为什么没有 strnchr 函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24466981/

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