In reply to samir singh:
Please use code tags in the future to make your code more readable.
Why do you need two separate variables: a rand class member addr AND an automatic task variable addr1? Which by the way is not legal to be declared as rand. Only class members can be declared as rand.
Why do you continue to use
addr = std::randomize(addr1)
What do you expect to happen to addr?