title: C# struct in a list
body: <p>Quick question about structs...
  I have a struct, lets pretend it looks like this:</p>
  
  <pre><code>struct myStruct {
       public int x, y;
  }
  </code></pre>
  
  <p>And then I make a list filled with that struct</p>
  
  <pre><code>List&lt;myStruct&gt; myList = new List&lt;myStruct&gt;;
  </code></pre>
  
  <p>And then later I loop through the list and I want to change the value of x...</p>
  
  <pre><code>for(int i=0; i&lt;myList.Count; i++) {
  
       ...//do stuff to x
  
       myList[i].x = newX;
  }
  </code></pre>
  
  <blockquote>
    <p>Cannot modify the return value of 'List&lt;myform.myStruct&gt;.this[int]'
    because it is not a variable</p>
  </blockquote>
  
  <p>Can you please clear up any confusion I'm having as to why it's not letting me change the value of x.</p>