Enter a number of students in a group as a command-line argument. Allocate memory for two arrays: one is the array of pointers to char to store students’ names, and another - an array of integers to store the results (from 0 to 100). Read the names and results from the keyboard and fill in the arrays. Find and display on the screen a name and a mark for students who have the lowest and the highest mark.
Well, I've been trying to do this for the last couple of days and I just can't figure it out.

Here's what I have so far:

Code:
int main(int argc, char *argv[])
{
    char * students;            // ? - 'char *students[]'
    int * scores;
    int num, i;
    int max = 0, min = 0, min_i, max_i;
    
    num = atoi( argv[1] );
    
    if ( num <= 0 )
    {
         printf("Please enter a number of students.\n");
         exit(0);
    }
    
    students = (char *) malloc( num * 15 * sizeof( char ) );
    scores = (int *) malloc( num * sizeof( int ) );
    
    for ( i = 0; i < num; i++ )
    {
        printf("Enter the student's name: ");
        gets( &students[i] );            // I know this is wrong, due to the declaration
        
        printf("Enter this student's score: ");
        scanf("%d", &scores[i] );
        fflush( stdin );
        
        printf("\n");
    }
    
    free(students);
    free(scores);
    
    
    system("PAUSE");	
    return 0;
}

* I am just making the assumption that each name will be no more than 14 characters long


As you can probably see from my highlighting, I can tell where my problems are - but it's a catch 22. If I declare an array of pointers to char in the beginning, I need to define a number of pointers the array will hold. But if I just declare a char pointer, when I malloc - it's just one chuck of memory. When indexed as an array, it will not be able to store a string, only a single char (per index).

Basically, my question is; is there any way to do this, other than reading in each character using getchar() and then appending my own null character at the end of each name?

Hopefully that all made sense.