Well if the implementation of srand() is only taking the high order bits of time, then in effect the PRNG is being seeded with a constant.
The low order bits of time() vary a lot, but around bit 16 say, that only changes about once a day.
Well if the implementation of srand() is only taking the high order bits of time, then in effect the PRNG is being seeded with a constant.
The low order bits of time() vary a lot, but around bit 16 say, that only changes about once a day.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.