Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

stack_create(3pub) [debian man page]

STACK(3pub)						       C Programmer's Manual						       STACK(3pub)

NAME
stack_create, stack_destroy, stack_pop, stack_is_empty, stack_copy, stack_push - manipulate stacks SYNOPSIS
#include <stack.h> Stack *stack_create(void); void stack_destroy(Stack *); void *stack_pop(Stack *); int stack_is_empty(Stack *); Stack *stack_copy(Stack *); int stack_push(Stack *, void *data, size_t bytes); DESCRIPTION
These functions operate on stacks. This manual page is shortish. SEE ALSO
publib(3) AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi) Publib C Programmer's Manual STACK(3pub)

Check Out this Related Man Page

MEMSHUFFLE(3pub)					       C Programmer's Manual						  MEMSHUFFLE(3pub)

NAME
memshuffle - make an array be in random order SYNOPSIS
#include <publib.h> void *memshuffle(void *block, size_t elsize, size_t elnum); DESCRIPTION
memshuffle will move around the elements of an array in a random fashion. It uses the standard library function rand(3) to get the pseudo- random numbers it needs. The caller must set a suitable seed with srand(3). RETURN VALUE
memshuffle returns its first argument. EXAMPLE
To shuffle an integer array one might do the following. int array[4] = { 1, 2, 3, 4 }; memshuffle(array, sizeof(array[0]), 4); BUGS
On many systems rand(3) is not of very good quality. However, it is the only random number generator that can be assumed to exist. Making it possible for the caller to provide an alternate source of random numbers (e.g., via a function pointer) is perhaps too more trouble than its worth. A better way would be for everyone to fix their rand's. SEE ALSO
publib(3), memrev(3), rand(3), srand(3) AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi) Publib C Programmer's Manual MEMSHUFFLE(3pub)
Man Page