title: How can I put an array inside a struct in C#?
body: <p>C++ code:</p>
  
  <pre><code>struct tPacket
  {
      WORD word1;
      WORD word2;
      BYTE byte1;
      BYTE byte2;
      BYTE array123[8];
  }
  
  static char data[8192] = {0};
  ...
  some code to fill up the array
  ...
  tPacket * packet = (tPacket *)data;
  </code></pre>
  
  <p>We can't do that as easy in C#.</p>
  
  <p>Please note there is an array in the C++ structure.</p>
  
  <p>Alternatively, using <a href="http://varjabedian.net/archive/2008/07/29/casting-a-byte-array-into-structures-in-c.aspx" rel="nofollow noreferrer">this source file</a> could do the job for us, but not if there is an array in the structure.</p>