gpt4 book ai didi

objective-c - 在 iOS 4.2.1 上,strnlen 未在此范围内声明

转载 作者:行者123 更新时间:2023-11-29 04:43:15 26 4
gpt4 key购买 nike

我有在 .mm 文件中使用 strnlen 的代码

使用 Xcode 4.2 时编译器可以正常构建。然而 Xcode 3.2.5 找不到 strnlen()...

我已经尝试过针对 strlen 发布的解决方案

#include <cstring> // doesn't work
using std::strlen; // doesn't work

#include <string> // doesn't work

有没有办法在 iOS 4.2.1 上使用 strnlen?

现在我只是转换为 NSString 对象并使用长度。

最佳答案

使用标准 C 函数 strlen 有问题吗?我查了一下strnlen,它似乎是一个GNU扩展。

关于objective-c - 在 iOS 4.2.1 上,strnlen 未在此范围内声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10037595/

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