我已经写了一个代码,其中有2-D向量作为组件。每当我给我的输入,1/2秒后,它显示了这个错误C++运行时奇怪的错误
"Terminate called after throwing an instance of ‘std::bad_alloc’
What(): std::bad_alloc
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application’s support team for more information."
,我的电脑速度变慢后,代码返回一个整数,直到我关闭该.exe文件它永远不会恢复其速度。
这是什么原因?如何避免这种错误?\ 我的代码是http://paste.ubuntu.com/6593192/
显示一些代码? – Blacktempel
没有你提供更多的数据,比如调试结果或者一段源代码,我们没有丝毫的想法。 – Spook
首先发布som代码:你是否以正确的方式分配指针?你如何毁灭它?你是否在循环中创建向量? –