【发布时间】:2018-11-05 00:09:48
【问题描述】:
我想在另一个向量的第一个条目内访问向量的第一个条目中的字符串。我的代码:
typedef std::vector<std::string> DatabaseRow;
std::vector<DatabaseRow*> data;
//getting data from database
//(dont need this for this example)
//then print first entry out
printf("%s.\n",dbresult.data[0][0].c_str());
然后我得到错误:
错误:'类 std::vector, std::allocator >, 标准::分配器, std::allocator > > >' 没有名为'c_str'的成员
有什么见解吗?
【问题讨论】: