0
我有以下多维向量多维向量指针
int main()
{
vector< vector<string> > tempVec;
someFunction(&tempVec);
}
void someFunction(vector< vector<string> > *temp)
{
//this does not work
temp[0]->push_back("hello");
}
我如何将数据推入载体时,我有一个向量的指针? 下面的代码不起作用。
temp[0]->push_back("hello");
你可能想要通过引用来获取整个事物,并使用点而不是箭头。 – chris
@chris对不起编辑。 – mister