如何查找下标越界的位置
程序偶尔能正常运行,偶尔不能。
挂掉的时候提示Microsoft Visual Studio C Runtime Library has detected a fatal error in myprogram.exe.
Press Break to debug the program or Continue to terminate the program.
下面是debug时的信息。
Debug Assertion Failed!
File: ...\vector
Line: 764
Expression: vector subscript out of range
For information on how your program can cause an assertion failure, see the Visual C++ document on asserts.
给出的提示是下标越界,我怎么去找哪个语句出现了越界啊?
因为程序比较长,单步运行比较困难,并且有些时候这个错误还不出现。
另外,我也读了一天代码了,也没有看出来哪有越界的。
有没有什么好的办法找到越界的位置啊?
挂掉的时候提示Microsoft Visual Studio C Runtime Library has detected a fatal error in myprogram.exe.
Press Break to debug the program or Continue to terminate the program.
下面是debug时的信息。
Debug Assertion Failed!
File: ...\vector
Line: 764
Expression: vector subscript out of range
For information on how your program can cause an assertion failure, see the Visual C++ document on asserts.
给出的提示是下标越界,我怎么去找哪个语句出现了越界啊?
因为程序比较长,单步运行比较困难,并且有些时候这个错误还不出现。
另外,我也读了一天代码了,也没有看出来哪有越界的。
有没有什么好的办法找到越界的位置啊?
...全文


