遇到严重的死循环求助 新评论 sungge 2009.08.16 06:51 我在求最近一个分形的值时遇到死循环,希望高手能帮帮我,谢谢了啊; 代码如下: int start() {int i,limit; int counted_bars = IndicatorCounted(); if(counted_bars < 0) return(-1); if(counted_bars > 0) counted_bars--; limit = Bars - counted_bars; for(i = 0; i <= limit; i++) { double FUP=iFractals(NULL, 0, MODE_UPPER, i+3); if(FUP==0){ for(int f=i+f;FUP==0;f++){ FUP=iFractals(NULL, 0, MODE_UPPER, f);} } } 为什么会死循环,该如何求出最近一个分形的值,请高手指教。 Number of bars from the last Fractal Up How to code? Array out of range exception when debugging okwh 2009.08.18 13:45 #1 for(int f=i+f;FUP==0;f++) 不要写这样的语句 ! f 也没有初值。 新评论
我在求最近一个分形的值时遇到死循环,希望高手能帮帮我,谢谢了啊;
代码如下:
int start()
{int i,limit;
int counted_bars = IndicatorCounted();
if(counted_bars < 0)
return(-1);
if(counted_bars > 0)
counted_bars--;
limit = Bars - counted_bars;
for(i = 0; i <= limit; i++) {
double FUP=iFractals(NULL, 0, MODE_UPPER, i+3);
if(FUP==0){
for(int f=i+f;FUP==0;f++){
FUP=iFractals(NULL, 0, MODE_UPPER, f);}
}
}
为什么会死循环,该如何求出最近一个分形的值,请高手指教。