git.samba.org
/
tridge
/
junkcode.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
up io error count if not exiting
[tridge/junkcode.git]
/
sortit.c
1
struct foo {
2
char user[20];
3
int x[10];
4
};
5
6
#define NUSERS 50000
7
8
struct foo users[NUSERS];
9
10
static int compar(struct foo *f1, struct foo *f2)
11
{
12
return strcmp(f1->user, f2->user);
13
}
14
15
main()
16
{
17
int i;
18
for (i=0; i<NUSERS; i++) {
19
sprintf(users[i].user, "USER%d", random());
20
}
21
qsort(users, NUSERS, sizeof(struct foo), compar);
22
}