question on using random in C on FC4 (perhaps slightly OT)
Globe Trotter
itsme_410 at yahoo.com
Wed Nov 16 14:47:37 UTC 2005
OK, now I have a real question: on my machine, I try the following....
%man random
and get a bunch of stuff about a random number generator.
....
SYNOPSIS
#include <stdlib.h>
long int random(void);
void srandom(unsigned int seed);
char *initstate(unsigned int seed, char *state, size_t n);
char *setstate(char *state);
....
CONFORMING TO
BSD 4.3
......
So, ignoring this, I use the following in a random number generator program and
get the following while compilation....
gcc -c -O3 -std=c99 -Wall -pedantic random.c
random.c: In function 'setseed':
random.c:35: warning: implicit declaration of function 'srandom'
random.c: In function 'runi':
random.c:48: warning: implicit declaration of function 'random'
But I have included stdlib.h so what is the problem?
Many thanks and best wishes,
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
More information about the users
mailing list