title: Populate String Array With For Loop and String Combintion in C#
body: <p>I have a string array defined as <code>String[] sEmails;</code> that I am trying to populate with 10 different (but similar) strings (email addresses in this case).</p>
  
  <p>Here is the code I'm trying to use to populate the array.</p>
  
  <pre><code>public void populateEmailArray()
      {
          for (int x = 0; x &lt; 10; x++)
          {
              switch(x)
              {
                  case 1:
                      sEmails[x] = sRepStuff + "1" + sGmail; 
                  break;
                  case 2:
                      sEmails[x] = sRepStuff + "2" + sGmail;
                  break;
                  case 3:
                      sEmails[x] = sRepStuff + "3" + sGmail;
                  break;
                  case 4:
                      sEmails[x] = sRepStuff + "4" + sGmail;
                  break;
                  case 5:
                      sEmails[x] = sRepStuff + "5" + sGmail;
                  break;
                  case 6:
                      sEmails[x] = sRepStuff + "6" + sGmail;
                  break;
                  case 7:
                      sEmails[x] = sRepStuff + "7" + sGmail;
                  break;
                  case 8:
                      sEmails[x] = sRepStuff + "8" + sGmail;
                  break;
                  case 9:
                      sEmails[x] = sRepStuff + "9" + sGmail;
                  break;
              }
          }
      }
  </code></pre>
  
  <p>The end result I want to be something like this</p>
  
  <p><code>sEmails['repstuff1@gmail.com','repstuff2@gmail.com','repstuff3@gmail.com']</code> and so and and so forth to repstuff9@gmail.com</p>
  
  <p>But on the first try of trying to set an <code>sEmails[x]</code> it gives me an error of "NullReferenceException was unhandled.  Object reference not set to an instance of an object."</p>
  
  <p>I have no idea what I'm doing wrong here because the code seems sound in my mind.  Any help on this would be greatly appreciated.</p>