c++ - 无法转换 'std::vector(*)[2]' 到 'std::vector**' 用于参数 '1' 到 'void getNextRowColumn(std::vector**)'
问题描述
解决方案
I guess you want to pass C array as an argument to a function then you need something like
void fn()
{
vector<ArrayIndex> IntermediateIndex[2];
getNextRowColumn(IntermediateIndex);
}
void getNextRowColumn(vector<ArrayIndex>* IntermediateIndex)
{
}
But since the question is tagged C++
you better stick to C++ semantics, for example
void fn()
{
array<vector<ArrayIndex>, 2> IntermediateIndex;
getNextRowColumn(IntermediateIndex);
}
void getNextRowColumn(array<vector<ArrayIndex>, 2>& IntermediateIndex)
{
}
Or use vector<vector<…>>
, depends on what you are going to do with it
推荐阅读
- laravel - (Laravel)LoginCotroller 使用了 AuthenticatesUsers 类,它在哪里?
- c++ - 直接使用c++流缓冲来解压
- c - /bin/ld: leetcode.c:(.text+0xfd): undefined reference to `fmax'
- chef-infra - 我必须在哪里指定本地模式下的运行列表?
- python - 如何使用 for 循环访问列表中的下一个元素
- react-native - 使用 react-navigation 显示用户令牌
- maven - 詹金斯中的 Maven:没有找到任何测试
- node.js - JSON作为sequlize中的属性不适用于Postgres
- python - 在python中使用shlex分割字符串时保留“\t”、“\n”、“\r”
- ssis - SSIS 中的 RestSharp 和框架配置