为什么此代码给出调试断言失败? std::string query; int ClientID = 666; query = "select logged from login where id = "; query.append((char *)ClientID);
3 回答
![?](http://img1.sycdn.imooc.com/533e4c9c0001975102200220-100-100.jpg)
POPMUISE
TA贡献1765条经验 获得超5个赞
您不能将int强制转换为char *以获取字符串。尝试这个:
std::ostringstream sstream;
sstream << "select logged from login where id = " << ClientID;
std::string query = sstream.str();
- 3 回答
- 0 关注
- 446 浏览
添加回答
举报
0/150
提交
取消