char temp 20 zap n2 while n- nx n2 n- nx while n2 if strcmp n- inf n2-

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
char temp[20];
zap *n = *h, *n2;
while (n->nx)
{
n2 = n->nx;
while (n2)
{
if (strcmp(n->inf, n2->inf) > 0)
{
strcpy(temp, n2->inf);
strcpy(n2->inf, n->inf);
strcpy(n->inf, temp);
}
n2 = n2->nx;
}
n = n->nx;
}