Why with this code:
unsafe
{
for (int i = 0; i < 10; i++)
{
Double w = new Double();
Console.WriteLine((IntPtr)(&w));
}
}
i'm always getting the same number? How to create new variables in a loop ? With new addresses ?
The reason, why this is a problem for me is that I need to generate a random double number and then I'm using a pointer (which references to that double) in two objects. In one of the object I'm changing this value and I want it to change in that other object too :)