為什么此代碼給出調試斷言失??? std::string query; int ClientID = 666; query = "select logged from login where id = "; query.append((char *)ClientID);
3 回答

POPMUISE
TA貢獻1765條經驗 獲得超5個贊
您不能將int強制轉換為char *以獲取字符串。嘗試這個:
std::ostringstream sstream;
sstream << "select logged from login where id = " << ClientID;
std::string query = sstream.str();
- 3 回答
- 0 關注
- 463 瀏覽
添加回答
舉報
0/150
提交
取消