Tri par nom dans une structure

Fermé
Hommels - 2 avril 2008 à 10:28
tatou_38 Messages postés 1937 Date d'inscription vendredi 21 avril 2006 Statut Membre Dernière intervention 5 août 2015 - 2 avril 2008 à 11:33
Bonjour,

//Table Index
struct ind
{
long NumProduit;
char NomProduit[30];
long Posi;

};

void main()
{
strucut ind index[100];

}
encodage index()
{
}
void affiche_ind(struct ind index[100], int* nproduit)
{
int i=0;

system("cls");

while(i<*nproduit) //nproduit = nombre des produits encoder!
{
entete();
printf("\n\tNumero du produit : %ld\n",index[i].NumProduit);
printf("\tNom Produit : %s\n",index[i].NomProduit);
printf("\tPosition au fichier 'Produit.dat': %ld\n\n",index[i].Posi);

i++;

system("pause");
system("cls");
}
}

Comment fait-on pour trié la structure avec nproduit des enregistrements dedans par le nomProduit?!
A voir également:

1 réponse

tatou_38 Messages postés 1937 Date d'inscription vendredi 21 avril 2006 Statut Membre Dernière intervention 5 août 2015 121
2 avril 2008 à 11:33
sort() !
0