for (i=b[1];i<b[1]+2;i++) for (j=b[0];j<b[0]+2;j++) printf("q_temp=%d\n",q_temp[i-b[1]][j-b[0]]); DSP? for 循环 [解决办法] 先确认i-b[1], j-b[0]会不会溢出q_temp的下标范围。 [解决办法] 两个for循环的范围不同,当然打印值不一样: for (i=b[1];i<b[3]+1;i++) for (j=b[0];j<b[2]+1;j++) ... for (i=b[1];i<b[1]+2;i++) for (j=b[0];j<b[0]+2;j++) 另外需查看数组的访问是否越界了。
[解决办法] To set a breakpoint when a variable q_temp[0][0] changes value
1.From the Edit menu, click Breakpoints. 2.Click the Data tab of the Breakpoints dialog box. 3.In the Expression text box, type the name of the variable q_temp[0][0]. 4.Click OK to set the breakpoint.
[解决办法]
这个是VC6 IDE下的。
帖主学习数据值改变断点正当时!
#include <time.h> #include <stdlib.h> #include <windows.h> int main() { int a,b[11];//本来是b[10],为判断哪句越界,故意声明为b[11]
srand((unsigned int)time(NULL));//按两次F11,等黄色右箭头指向本行时,调试、新建断点、新建数据断点,地址:&b[10],字节计数:4,确定。 while (1) {//按F5,会停在下面某句,此时a的值为10,b[10]已经被修改为对应0..4之一。