我用C++完成了程序的编写。我用“cout”来调试。一切正常,我删除了调试注释,但是运行程序有问题。当我使用评论时,一切都很好。但是当我删除它们时,程序就会启动,允许我写文件名,但是当我按下'enter‘时,会发生错误:
0x0142d866处的未处理异常( Pathfinder.exe: 0xC0000005:访问冲突读取位置0xcccccc70 )
并打开xiosbase头文件,指示
fmtflags __CLR_OR_THIS_CALL flags() const
{ // return format flags
return (_Fmtfl);
}当我试图在Map中放置元素时,会发生错误。只有在不同函数中删除调试注释时,才会发生这种情况。有人能帮忙吗?
-this 0xcccccc6c {_Stdstr=??? _Mystate=??? _Except=??? ...} const std::ios_base * const
std::_Iosb<int> {...} std::_Iosb<int>
__vfptr CXX0030: Error: expression cannot be evaluated
_Stdstr CXX0030: Error: expression cannot be evaluated
_Mystate CXX0030: Error: expression cannot be evaluated
_Except CXX0030: Error: expression cannot be evaluated
_Fmtfl CXX0030: Error: expression cannot be evaluated
_Prec CXX0030: Error: expression cannot be evaluated
_Wide CXX0030: Error: expression cannot be evaluated
_Arr CXX0017: Error: symbol "" not found
_Calls CXX0017: Error: symbol "" not found
_Ploc CXX0017: Error: symbol "" not found
_Index 0 int
_Sync true bool发布于 2011-06-12 03:47:31
这将是一个真正痛苦的故障排除通过分析代码。其他人给你指明了一个很好的方向,但是如果你没有看到一些明显的东西,比如一个未初始化的指针,那么它可能是某种内存损坏。
启用全页堆用于您的程序,然后在调试器中再次运行。如果不是在腐败点,它应该会更早崩溃,这将为您提供更多的信息。
https://stackoverflow.com/questions/6316804
复制相似问题