how to allocate memory for a pointer parameter to an array through a function in C#
<p>How can i send a ref pointer to a function and return an address to an allocated memory, in C#. The following code doesn't compile:</p>

<pre><code>class Test
{
    public byte [] byteArr_1 = new byte [1024];
    //public byte* P_byte;

    public unsafe void SetAddress(ref byte* p_b)
    {
        p_b = &amp;byteArr_1[0];
    }
}
</code></pre>

<p>This is the error i receive:</p>

<blockquote>
  <p>You can only take the address of an unfixed expression inside of a fixed statement initializer</p>
</blockquote>

<p>Originally i was using a usb transmit dll that received and initialized a *byte pointer for a buffer when the connection was established. Now i would like to change that dll with a different platform with minimum changes in code, so i need to initializer the buffer myself.</p>

<p>Thanks,</p>
