To save a list of names, you would need a two dimensional array (length and width).

Instead of name1[10] which is one dimensional, you need names[10][20]. That would give you room for ten names, with a maximum length of any name, being 19 chars long.

If you wanted 20 names, you'd need names[20][20].

Instead of using several if statements, you need only one, as I showed you above. If the name is greater than the last name in the array, you don't need to do anything with it - at all.

If it is less (you don't have to do anything with the same name, either), then you need to decrease the index to the array, and re-compare the current name, with the name one up in the array.

P.S. When you print a name, scanf() for a name, or fscanf(), the format you need is %s, instead of %c. %c is for a single char, whereas %s is for a string.

When you have a million names to deal with, what you DON'T do in your program, is just as important as what you DO.

You don't know how to use fscanf()? Consult the C tutorial, and it will show you. It works just like the scanf(), except you add the file pointer as the first argument to the fscanf(filePointer, "%s", array[i]), code.