I am creating a program that sorts a matrix of structures, first sorts the rows and goes to each row and arranges them by columns. In the array that I am using at the end of two cycles the value of (i+1 = 4)
, when I call again the function aux is supposed to (l = 4 and r = 4) and should not enter into if, can someone tell me why?
void aux(int l, int r){
int i;
int auxx = 0;
printf("%d, %d\n", l, r);
if(l != r){
for(i = l; i <= r; i++){
if(matrix[i].line == matrix[i+1].line){auxx = auxx +1;}
else{
if(auxx==0){aux(i+1, 4);}
else{
printf("%d\t%d\t%d\t%d\n", i+1, l, auxx+l, 4);
bubblec(l, auxx+l);
aux(i+1, 4);}
}
}
}
}
aux(0, 4);