j'ais en langage C une table MaTbl[1000][51]
les cinquantes caractéres sont une clé. Je veux la trier
pour cela j'utilise ce code, mais in ne marche pass ??
Pouvez vous m'aider ? merci d'avance
Bien sur MaTbl et MaTblNbr sont définis
MaTblNbr est le nombre de datas saisis
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 void tritout(void) { int axx,Limit; int Cok,Rang; unsigned char LWrk[51]; Limit=MaTblNbr-1; do { Cok =0; for(Rang = 2; Rang<Limit; Rang++) { axx=0; axx=_mbscmp(MaTbl[Rang],MaTbl[Rang+1]); if(axx>0) { strcpy(LWrk,MaTbl[Rang]); LWrk[50]='\0'; strcpy(MaTbl[Rang],MaTbl[Rang+1]); MaTbl[Rang][50]='\0'; strcpy(MaTbl[Rang+1],LWrk); MaTbl[Rang+1][50]='\0'; Cok = Rang; } } Limit=Cok; } while (Cok); return ; }
Partager