문제

The code:

while ((row = mysql_fetch_row(pRes))) {
        TMPTable temp = {};
        if (row[0]) temp.con = strtoul(row[0], NULL, 10);
        std::vector<MATable>.push_back(temp);
}

Error on the line with TMPTable temp = {};:

in C++98 'temp' must be initialized by constructor, not by '{...}'

Another problem is :

std::ostringstream query;

Giving the error:

aggregate 'std::ostringstream query' has incomplete type and cannot be defined

I have tried the solutions on google, but havent found any working one... Always ending up with an error. Could you guys point me in the right direction?

도움이 되었습니까?

해결책

You'll need to include <sstream> to get a definition of std::ostringstream. To address the initialization you can simply use

TMPtable tmp = TMPtable();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top