I wrote this C code below, when I loop, it returns a random number. How can I achieve the 5 different random values if myrand() is executed?
#include
The point of seed() is to start the sequence of random numbers with a known value,
you will then always get the same sequence of numbers given the same seed.
This is why you have seed(), it both allows you to generate the same sequence for testing, or given a random seed (typically the time) you get a different sequence each time