本文介绍了Turbo C ++无法完成嵌套循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我尝试做这样的嵌套循环 for(i = 0; i< = 640; i ++) { for(j = 0; j< = 640; j ++) { if(getpixel(j,i)!= 0){ printf(这是一个彩色像素); } } } 但c不能完成此循环并停止在进程中间为什么? 内存限制可能? 任何帮助解决?解决方案 C图形分辨率为640 x 480,因此您无法在640,640处搜索像素 Savage 这不是问题 即使我尝试,例如; (500,500)问题仍然存在 似乎我的borland turbo c 4.5无法处理多次迭代 如果我循环通过500 * 500像素,其等于625000次迭代 我的程序只是在中间逃脱而没有竞争循环 但是如果尝试减少迭代,例如(250 * 125)它可以成功完成 任何建议? i try to do nested looping like this for (i=0;i<=640;i++){for(j=0;j<=640;j++){if(getpixel(j,i)!=0) {printf("this a color pixel); }}} but c can''t complete this loop and stop in the middle of process why?memory limitation maybe? any help to solve? 解决方案 The C graphics resolution is 640 x 480 so you cannot search for pixel at 640,640 Savage that was not the problemeven i try, eg; (500,500) the problem was still occurit seems that my borland turbo c 4.5 can''t handle to many iteration if i looping through 500*500 pixel, its equal to 625000 iterationand my program just escape at the middle without compelete that loop but if try to decrease the iteration eg(250*125) it can complete succesfully any suggestion? 这篇关于Turbo C ++无法完成嵌套循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-18 17:48