ho il seguente codice, come faccio a mettere il tutto in ordine alfabetico?
so che devo usare la strcmp, ma non riesco a implementare il codice...
codice:
# include <stdio.h>
#include <string.h>
int i;
typedef struct {
char nome[30];
char cognome[30];
} nominativo ;
struct personanew {
nominativo name;
};
struct personanew numero_utenti[99];
int main (){
strcpy (numero_utenti[0].name.nome , "rossella");
strcpy (numero_utenti[1].name.nome , "anna");
strcpy (numero_utenti[2].name.nome , "massimo");
strcpy (numero_utenti[3].name.nome , "antonio");
strcpy (numero_utenti[4].name.nome , "luca");
strcpy (numero_utenti[5].name.nome , "matteo");
strcpy (numero_utenti[6].name.nome , "gloria");
etc...
etc...
}