NAME
reorder - randomly reorder the elements of a one-dimensional array
SYNOPSIS
reorder (array, len, eltsize)
char *array;
int len, eltsize;
DESCRIPTION
reorder
randomly rearranges the elements of a one-dimensional array of
elements of any size.
array
is a pointer to the beginning of the array;
len
is the number of elements in the array;
eltsize
is the size in bytes of a single element of the array.
As
reorder
depends on the pseudo-random number generator
rand(3P)
,
srand
should be called to set the generator to a random starting point
before calling
reorder
for the first time.
EXAMPLES
Reorder
NOBJ
elements of an array of structures of type
object
starting at
ob.
struct object ob[NOBJ];
reorder(ob,NOBJ,sizeof(strct object));
SEE ALSO
nrand(3U)
,
rand(3P)