Thanks for your answers!
Yes, my idea is to dolike you told me. For example, if I have 5 names and I want just the first 3 alphabetically:
I have: John, Pete, Paul, Roger, Aaron
First of all, I save in an array the first 3: John, Pete, Paul
Now, I order those names and I have: John, Paul, Pete
Now, I have 'Roger'. I compared it with Pete. It's "bigger", so I have again: John, Paul, Pete
Now, I have 'Aaron'. I compared it with Paul. It's "smaller", so I compared it with Pete. It's also "smaller", so I compared it with John. It's "smaller". So I put Aaron instead of John. John instead of Paul and Paul instead of Pete.
I don't know too much of programming in C. I don't know how I can "read" the names that I receive in a .txt and how to compare them. If I have 2 strings, I compared them like this:
Code:
char name1[10], name2[10];
printf("Name 1: ");
scanf("%c", &name1);
printf("Name 2: ");
scanf("%c", &name2);
if (strcmp(name1, name2)) == 0
printf("Same name");
if (strcmp(name1, name2)) > 0
printf("%c is bigger than %c", name1, name2);
if (strcmp(name1, name2)) < 0
printf("%c is bigger than %c", name2, name1);
And I also don't know how to save the first 100 names.
Thanksssssss