barry_di 2018-01-15 08:19 采纳率: 100%
浏览 1169
已结题

mongoDB c++ 更新插入数据时BSONObjBuilder对象在函数返回时出错

 BSONObjBuilder data;
data.append("Date",newtime);
data.append("OpenPrice",strOpenPrice);
data.append("HighPrice",HighPrice);
data.append("LowPrice",LowPrice);
data.append("ClosePrice",ClosePrice);
data.append("AvgPrice",strAvgPrice);
data.append("Amount",strAmount);
data.append("Hold",strHold);

BSONObjBuilder builder;
builder.append("$set",data.obj());
conn.update(ns,condition,builder.obj(),true,true);

函数里这段代码执行完以后当函数返回时报错:
Run-Time Check Failure #2 - Stack around the variable 'builder' was corrupted.
Run-Time Check Failure #2 - Stack around the variable 'data' was corrupted.

  • 写回答

4条回答 默认 最新

  • gilberthui 2018-01-15 08:36
    关注

    您好,您的堆栈被破坏了,重新弄一下就好了~~

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?