的代码:转换C++ 11码到C++ 98
while ((row = mysql_fetch_row(pRes))) {
TMPTable temp = {};
if (row[0]) temp.con = strtoul(row[0], NULL, 10);
std::vector<MATable>.push_back(temp);
}
就行错误与TMPTable temp = {};
:
in C++98 'temp' must be initialized by constructor, not by '{...}'
的另一个问题是:
std::ostringstream query;
给出错误:
aggregate 'std::ostringstream query' has incomplete type and cannot be defined
我已经尝试在谷歌的解决方案,但还没有找到任何工作一个。总是有错误结束了。你们能否指出我正确的方向?
第二个看起来像你没有包含头文件(这是一样容易出错的C++ 11)。 – chris
第一个示例有语法错误。 – 0x499602D2