你好,我正在试图做一个包装处理来自MySQL查询的行和列结果。语句的返回数据可以是字符串或NULL指针。所以这里是我的尝试:多维向量字符串
class RowWrapper {
public:
std::vector< std::vector <std::string> > data;
void SetVector(unsigned int rows, unsigned int columns);
};
void RowWrapper::SetVector(unsigned int rows, unsigned int columns)
{
for (int x = 0; x > rows; x++)
{
std::vector<std::string> p_rows;
for (int y = 0; y > columns; y++)
{
p_rows.push_back(x*y); //Error here
}
data.push_back(temp_rows);
}
}
我有的错误是没有重载函数的实例,可能缺少关于向量或字符串的东西。
您试图将'int' push_back到'vector'中。 –
Mat
2012-08-05 09:02:43