读书人

体验帖

发布时间: 2013-01-17 10:28:54 作者: rapoo

感受帖
当代码出错时(逻辑错误),实在找不出原因时,让别人帮忙找,结果找了半天最后发现是很小的错误,甚至就是可能出错的地点就是自己调试时关注的区域的很接近的部分,然后立马就产生了当局者迷,旁观者清的感觉.体验帖

不值到大家有木有 曾经有过
[解决办法]
体验帖
[解决办法]
还是对调试环境使用不熟练:
参考:
To set a breakpoint on a message

From the Edit menu, click Breakpoints.
The Breakpoints dialog box appears.
Click the Messages tab.
In the Break At WndProc text box, type the name of the Windows function.
If you are setting a breakpoint during a debug session, the list contains the exported functions in your project.
In the Set One Breakpoint For Each Message To Watch list box, select the message.
To set another breakpoint, press ENTER, and then repeat steps 3 and 4.
The Breakpoints list displays the currently active breakpoints.
Click OK to set the breakpoints.
--------------
To set a breakpoint when a variable changes value

From the Edit menu, click Breakpoints.
Click the Data tab of the Breakpoints dialog box.
In the Expression text box, type the name of the variable.
Click OK to set the breakpoint.
--------------
To break when any element of an array changes value

From the Edit menu, click Breakpoints.
Click the Data tab of the Breakpoints dialog box.
In the Expression text box, type the first element of the array (myArray[0]).
In the Number Of Elements text box, type the number of elements in the array.
Click OK to set the breakpoint on myArray.
[解决办法]
崩溃的时候在弹出的对话框按相应按钮进入调试,按Alt+7键查看Call Stack里面从上到下列出的对应从里层到外层的函数调用历史。双击某一行可将光标定位到此次调用的源代码或汇编指令处。

[解决办法]
总让别人帮忙找bug,那自己找bug的本事啥时候能得到锻炼并提高呢?
[解决办法]
有过,很低级的错误
[解决办法]
祝你好运!!
[解决办法]
逻辑错误首先是自己很难发现的错误,因为你的思维就是那么想的,自然很难查找出来,换人找是不错的选择。
不过太弱智的逻辑错误就是基本功不扎实的表现了,或者换句话说,压根不应该出逻辑上的错误。

读书人网 >C++

热点推荐