D
DaTurk
If I call this method, and pass it a byte[] by ref, and initialize
another byte array, set the original equal to it, and then null the
reference, why is the original byte array not null as well? I thought
passing by reference, your passing the address in memory.
public bool DoSomething(ref byte[] data)
{
byte[] retVal = null;
try
{
retVal = new byte[data.Length];
data = retVal;
}
catch (Exception ex)
{
}
finally
{
retVal = null;
}
}
another byte array, set the original equal to it, and then null the
reference, why is the original byte array not null as well? I thought
passing by reference, your passing the address in memory.
public bool DoSomething(ref byte[] data)
{
byte[] retVal = null;
try
{
retVal = new byte[data.Length];
data = retVal;
}
catch (Exception ex)
{
}
finally
{
retVal = null;
}
}