I have the following code for getting a double from a normal distribution.
I call the function during several times in a program but it gives the same result everytime. Could anyone help me please? How can I make it, give different results each time I call it?
Your function creates a new random number generator every time, seeded with zero (or with time(), after you tried Peter87's suggestion), but the next time you call this function, you're recreating the random number generator, and you're re-seeding it with zero (or with time(), which likely hasn't changed since a full second didn't pass)
Only create the RNG once, and pass it to your function by reference.