title: Using Arrays in Visual C#?
body: <p>I have a function that takes an array as a parameter. The function then fills the array up with information of unknown length. So how would I create an array to store a message of unknown length? Because I can't specify the size of the array since I don't know the size of the message it is going to store.</p>
  
  <p>Would this be valid?</p>
  
  <pre><code>byte [] array;
  function (array);
  </code></pre>
  
  <p>And then the size of the array will be determined by the size of the message it is filled in? 
  If this isn't possible how would I do this?</p>
  
  <p>I need the array to be the exact size of the message it is filled up with, so I can't just specify the array to be some random size big enough to fit the message.</p>
  
  <hr>
  
  <p>Additional, from a comment:</p>
  
  <pre><code>public int ReceiveFrom( byte[] buffer, int offset, int size, 
         SocketFlags socketFlags, ref EndPoint remoteEP ) 
  </code></pre>