首页 新闻 会员 周边

vector 和 string

0
悬赏园豆:20 [待解决问题]

今天遇到这样一个问题:std::vector< std::string > _values;

_values.push_back( "string" ); 会中断,信息如下

A buffer overrun has occurred in HDRRendering.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.
For more details please see Help topic 'How to debug Buffer Overrun Issues'.

中断位置gs_report.c中的

  if (!DebuggerWasPresent)    {        _CRT_DEBUGGER_HOOK(_CRT_DEBUGGER_GSFAILURE);    }

 

不知谁遇到这种问题没

Aldrich的主页 Aldrich | 初学一级 | 园豆:170
提问于:2010-12-09 21:47
< >
分享
所有回答(2)
0

建议google下。我是菜鸟

Rollen Holt | 园豆:210 (菜鸟二级) | 2010-12-20 22:28
0

会不会是别的模块问题引起的,先人肉检查一下申请空间相关代码,不行就采用隔离法。

比如把你怀疑的代码抽出来单独测试试试。

从你贴出来的代码不应该会有问题的呀

int _tmain(int argc, _TCHAR* argv[])
{
std::vector< std::string > _values;
_values.push_back( "string" );
胡屯 | 园豆:714 (小虾三级) | 2011-11-23 12:37

我也觉的是别的模块问题引起的

支持(0) 反对(0) Rollen Holt | 园豆:210 (菜鸟二级) | 2012-04-30 23:22
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册