I'm trying to understand multiple goto's in a function. For the code below, if it goes to Return1 & does the line:
RetVal++; , would it then go back into the loop or would it proceed down to the line: return RetVal; ? Thanks for the help!
Code:int one_bisect(int type, int l_et) { int i; int line[7]; int RetVal = 0; if (type == -1) { for (i = 0; i < 3 + 1; i++) if ((line[i] - line[i + 3]) > l_et) goto Return0; goto Return1; } else { for (i = 0; i < 3 + 1; i++) if ((line[i + 3] - line[i]) > l_et) goto Return0; goto Return1; } Return1: RetVal++; //would this go back to the loop or to return RetVal? Return0: return RetVal; }




Reply With Quote