Topic: Randomize
Author: james.tanis@atlwin.com (James Tanis)
Date: 28 Apr 94 07:27:00 GMT Raw View
I am very new with C & C++ and was wondering if they had
somekind of randomize statement. (Like QBasics RANDOMIZE TIMER only in
C's confusing lingo (G) ). If you could help me with this I would be
very greatfull.... And it would be nice if you could tell me how to
initialize the variables to be random (hopefully this is possible).
Later,
James
----
+---------------------------------------------------------------------+
| The Atlanta Windows BBS (404)516-0048 9 high-speed USR nodes |
+---------------------------------------------------------------------+
Author: rick.fry@delta.com (Rick Fry)
Date: Thu, 28 Apr 94 14:30:00 -0500 Raw View
JM>initialize the variables to be random (hopefully this is possible).
int rand(void);
rand uses a multiplicative congruential random number generator with period
2 [to the 32 power] to return succesive pseudorandom numbers in the range
from 0 to RAND_MAX. The sympolic constant RAND_MAX is defined in the
stdlib.h file.
I hope that helps. I am just as new at this as you are. The above is quoted
from my Borland C++ 4.0 Library Reference manual.
Rick Fry InterNet - Rick.Fry@Delta.Com RIME ->DELTA
C'Serve 74363,1120 FidoNet - 1:115/107 BBS 919/481-9399
---
DeLuxe /386 1.25 #3380 ONE BBSCON?? I'm the fat/ugly one at deltaComm.