Working on to print the 10 longest words from a file (one word per line). Words can be printed in any order, and if there are multiple words tied for 10th longest we can decide what to do. The following prints top 1, appreciate any suggestions to build a loop that can iterate and print the next 9. Assumptions made here, the longest word in the file can be 200 letters and 60 spaces in b/w them. I'm looking to exclude both the assumptions and make it to work more dynamically. Though the following is C like to hear any to write in C++ as well but need to avoid using STL. 

```
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#define MAX_WORD_LENGTH 200

int main () {
FILE *fp = fopen("words.txt","r");
char str[60];
char *largest = (char*) malloc (MAX_WORD_LENGTH);
int smallest_len = MAX_WORD_LENGTH, largest_len = 0;

while (fgets (str, 60, fp) != NULL) 
{
    char *temp = strtok(str, "\n");
    while (temp != NULL) 
    {
        if (strlen(temp) > largest_len) 
        {
            strcpy(largest, temp);
            largest_len = strlen(largest);
        }
        temp = strtok(NULL, "\n");
    }
}

printf("The largest word in the file is: %s\n", largest);

fclose(fp);

return 0;
}

```