Tuesday, August 9, 2011

random.c

% cat random.c
#include
#include
#include
#include

int main(int argc,char* argv[])
{
unsigned int i=0;

initstate(random(),(char*)argv,argc);

for (i=0;i
fprintf(stderr,"%d\n",random());

return EXIT_SUCCESS ;
}

% cat Makefile
CC=cc
FLAGS=-ansi -static -Wall --pedantic

random: random.c
${CC} ${FLAGS} -o random random.c

% make
% ./random 1>random.out 2>random.err
...

No comments:

Post a Comment