gpt4 book ai didi

c++ - 将字符串数组传递给函数 C++

转载 作者:行者123 更新时间:2023-11-28 03:14:58 24 4
gpt4 key购买 nike

我想将一个字符串数组传递给这样的函数 int function (string text[]) 。但是 IntelliSense 说标识符字符串是 undefined 。为什么我不能像通常使用 int 数组那样传递字符串数组?

最佳答案

您使用的是 std::string 还是仅使用 string?如果您的代码中没有 using std::string,请尝试添加它。

关于c++ - 将字符串数组传递给函数 C++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17198987/

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