If you look at the implementation posted by Elysia,
and consider that srand() [in essence if not in fact] sets _holdrand to the value you pass in, then you'll see that it's perfectly possible to predict the outcome of the random number.Code:_ptiddata ptd = _getptd(); return( ((ptd->_holdrand = ptd->_holdrand * 214013L + 2531011L) >> 16) & 0x7fff );
So if you pass in a constant to srand(), you will get a constant value out every time. If you can provide a good random number as input, then it will provide a different number than the input, but directly related and predictable if we know the original number.
--
Mats