You create the RNG with the same seed each time you call the function so that is why you always get the same number. To get different numbers you should reuse the same RNG to generate all the random numbers.
@Cubbi, your solution really helps!To make the variable "engine" static is to make sure even when the method GetRN() ends, the variable "engine" remains its value. So the next time when GetRN() is called, the value of "engine" is still the same? I think I am quite lost on the logic behind your solution, can you kindly give me more information? Thanks thanks!
@Peter87, thanks for your clarification! I tried to put this method into a class URandom. When I generate different objects of URandom and then call this method from these objects, they still give me the same number. So, using this RNG method via different objects is actually NOT reusing the RNG to generate random numbers?