title: having problems getting the correct size of data(struct)
body: <p>I am testing <code>struct</code> vs <code>class</code> vs <code>Tuple&lt;int,char[]&gt;</code>
  in both managed vs <code>unsafe</code> parallel and normal execution
  so to get the size of data handled in each case i have issues getting the correct size of <code>valueType</code></p>
  <pre><code>public struct Schar
  {
      public int V;
      public char[] ChrArr;
  }
  Schar tSchr = new Schar()//set value: V=1,ChrArr= 'a','b','c','d','e'...
  </code></pre>
  <p>now when I set <code>tSchr</code>, no matter size of <code>ChrArr</code>, I get same results
  (8 @<code>I386</code> and 16 @<code>AMD64</code>)</p>
  <p>I have tried <code>sizeOf</code> /<code>Marshal</code></p>
  <pre><code>    unsafe int GetDataSizeOf(System.ValueType TestedSchar)//could be any Structure not specifically 'Schar'
      {
          int rt=Marshal.SizeOf(TestedSchar);
              //return sizeof(TestedSchar);
      }
  </code></pre>
  <p>I could have add a <code>Length</code> parameter to <code>GetDataSizeOf</code> and multiply but it will be OK only if I pass <code>Schar</code> type of <code>struct</code> and not any other.
  if another struct will have 2 <code>char[]</code> fields or other variation of other forms it would not be OK to count the length and so...</p>
  <p>How is the correct way to implement a size of in unmanaged ?</p>
  <h2>update</h2>
  <p>this next struct is <code>blittbale</code>
  which does get the correct size when I have tested it via <code>GetDataSizeOf()</code></p>
  <pre><code>public unsafe struct chars32A
  {
      public int V1;
      public int V2;
  }
  </code></pre>
  <p>what if i make another one made of the above struct as follows,</p>
  <pre><code>public unsafe struct chars32
  {
      public chars32A Fld1;
      public chars32A Fld2;
  }
  </code></pre>
  <p>do i have to check each field within the struct for its size too ?</p>