View Single Post
Old 09-23-2003, 07:14 PM   #2 (permalink)
palin
Code Monkey
 
palin's Avatar
 
Join Date: Jan 2003
Posts: 57
palin is on a distinguished road
ok what kind of errors are you getting?

something i notice off the bat
1. you should declare your variables to store test scores in the main function and pass them to your later functions.

2. int& ? are you trying to declare a int pointer if so the syntax is int*
& means address of.

3. I would check to see the lowest score by testing the first 2 and then take the lowest for the next. I would also use an array to store the integers.

Code:
int current = 0;
int next = 1;

for( int i; i < ARRAY_SIZE-2; i++){
   if ( score[next] < score[current] ){
      current = next;
      next++;
    }
}
when that code finishes executing then current will contain the index of the lowest score. you could also fill the array so that it is sorted from lowest to highest.
palin is offline   Reply With Quote