title: C# Array without a specified size
body: <p>I've got a question about creating an array in C# when I don't know the exact number of elements.  I've found multiple questions that are similar, like <a href="https://stackoverflow.com/questions/14608797/making-an-array-of-an-unknown-size-c-sharp">this one</a>.  The recommendation there is to use a List instead of an Array.  In that example and in all others I've seen its to instantiate a List of 'string's.  Can I do the same with a struct?</p>
  
  <p>For example, I have the following struct that I use to store failure information, but I have no idea at the start of test how many failures will occur.  It could be 0, it could be hundreds.</p>
  
  <pre><code>    public struct EraseFailures
      {
          public string timestamp;
          public string bus;
          public string channel;
          public string die;
          public string block;
      }
  </code></pre>
  
  <p>So can I create a List of these as well?</p>
  
  <pre><code>    List&lt;EraseFailures&gt; eFails = new List&lt;EraseFailures&gt;();
  </code></pre>
  
  <p>It compiles just fine, but I want to make sure this is the best way of doing this.  And if it is, what is the syntax for adding values to my List?  Because the following doesn't seem correct...  </p>
  
  <pre><code>     eFails.bus.Add("bus0");
  </code></pre>
  
  <p>Seems like I might have to create a new struct with the values I want and then add that to the List.  </p>