Ok I dont know what I am doing wrong, I read through about 30 threads on here and tried googling for something that might help me out.
I found one with a problem pretty close to mine and I tried out using what worked for that person (strcmp) but that makes the output even worse then what it is for what i have now.
If I comment out this function the program works ok, it calculates the summary fine, prints everything out fine but as soon as I compile and run with this in it ... I get some strange outputs and only the first few records are in order. I am really lost as to what I have done wrong here.
I know there are tons of questions already posted about bubble sorting and I apologize for having to ask yet another ;p
Code:void SortArrs () { for(i=0; i<RECORDCOUNT-1; i++) for(j=0; j<RECORDCOUNT-1; j++) if (FNAME[i]>FNAME[j]) { strcpy(temp, FNAME[i]); strcpy(FNAME[i], FNAME[j]); strcpy(FNAME[j], temp); strcpy(temp, LNAMEARR[i]); strcpy(LNAMEARR[i], LNAMEARR[j]); strcpy(LNAMEARR[j], temp); strcpy(temp, CLASSARR[i]); strcpy(CLASSARR[i], CLASSARR[j]); strcpy(CLASSARR[j], temp); temp[15] = CHARGEARR[i]; CHARGEARR[i]=CHARGEARR[j]; CHARGEARR[j]= temp[15]; temp[15]= GSTARR[i]; GSTARR[i]=GSTARR[j]; GSTARR[j]= temp[15]; temp[15]= PSTARR[i]; PSTARR[i]=PSTARR[j]; PSTARR[j]= temp[15]; temp[15]= TOTALARR[i]; TOTALARR[i]=TOTALARR[j]; TOTALARR[j]= temp[15]; } }