I am relative new to c and c++. In java, the language I am used to program in, its very easy to implement random number generation. Just call the the static random-method from a class called Math.
int face = ((int)(Math.random() * 6) + 1);
simulates a dice-throw ...
In c and c++ you have to "seed the random number generator" , by calling the srand-function
srand ( time(NULL) );
What is the point of doing this - I mean is there any advantage of having to seed the random number generator every time the code is run?
The advantage is that you can repeat a random number sequence by supplying the same seed.
The game Elite used this to store an entire world, consisting of thousands of stars, as a single number. To generate the exact same world a second time, the just supplied the same seed.