lundi 16 mars 2015

c++ If loop doesn't go through all possibilities !!?!! Weird?

Very weird issue. I initialize integers with "int m = 0;" for each. You don't have to understand everything, just the fact that I count the number of times I go through each branch. Finally, when I print, m != l+h+f+e+g !!! (m = 78569040, g=h=l=0, e=8407560 f=9786560)



bool bo(true);
if (P[j].ipass==Npass-1 && !(kind=="ELG" || kind=="SS" || kind=="SF")) { e++; bo = false; }
else if (find_collision(j,k,g,pp,G,P,A)!=-1) { f++; bo = false; }
else if (kind=="SS" && A.nkind(j,k,"SS",G,P,pp,F)>=MaxSS) { g++; bo = false; }
else if (kind=="SF" && A.nkind(j,k,"SF",G,P,pp,F)>=MaxSF) { h++; bo = false; }
else l++;
m++;


Besides, I tried to count something else in the same way and it gave me a negative number.


Thanks !


Aucun commentaire:

Enregistrer un commentaire