title: Rename individual variables and assign them values from a List with a For loop C#
body: <p>I have a list of items (Tlist) and I want to assign them consecutively to individual variables (T0-T4) which can be named also consecutively.</p>
  
  <pre><code>        List&lt;int?&gt; Tlist = new List&lt;int?&gt;();
  
          Tlist.Add(1);
          Tlist.Add(4);
          Tlist.Add(3);
          Tlist.Add(1);
          Tlist.Add(5);
  
          int? T0 = null;
          int? T1 = null;
          int? T2 = null;
          int? T3 = null;
          int? T4 = null;
  </code></pre>
  
  <p>So I can do:</p>
  
  <pre><code>        int g = 0;
          T0 = Tlist[g++];
          T1 = Tlist[g++];
          T2 = Tlist[g++];
          T3 = Tlist[g++];
          T4 = Tlist[g++];
  </code></pre>
  
  <p>But, how can I rename the variables T0-T4 within a Forloop to deliver the same output without having to rewrite each of the variables? I would like something like:</p>
  
  <pre><code>        int g = 0;
          for (int i = 0; i &lt; Tlist.Count; i++)
          {
              Tg++ = Tlist[g++];
          }
  </code></pre>
  
  <p>So the output is:</p>
  
  <pre><code>        T0 = 1
          T1 = 4
          T2 = 3
          T3 = 1
          T4 = 5
  </code></pre>
  
  <p>Thanks for your help!</p>