DMISort

4.3.1/10
La funzione ordina il contenuto della DMI di riferimento

Sintassi

void DMISort(_DMI * psDmi, int (__cdecl * funcCompare )(const void *elem1, const void *elem2 ) );

Parametri


Valori di ritorno

Nulla.

Commenti


//
// ElementSort
// ORDINA GLI ELEMENTI NELLA DMI
// gli elementi dell' esempio sono GRUPPO , IDCODE e LINGUA
//
int ElementSort(const void *pElem1, const void *pElem2)
{
 S_MB_ELEMENT * psElem1=(S_MB_ELEMENT * ) pElem1;
 S_MB_ELEMENT * psElem2=(S_MB_ELEMENT * ) pElem2;

 if (psElem1->iGruppo>psElem2->iGruppo) return 1; else if (psElem1->iGruppoiGruppo) return -1;
 if (psElem1->idCode>psElem2->idCode) return 1; else if (psElem1->idCodeidCode) return -1;

 return 0;
}

DMISort(&dmiElement,ElementSort);

Easyhand C/C++: DMISort | Last modified: 06/03/2012 19.24.41 Europe/Rome | #1.115
P.. 117
Easyhand C/C++
Una mano alle tue idee.
Privacy Policy