title: ArrayList to int[] in c#
body: <p>I have my declaration as follows</p>
  
  <pre><code>int[] EmpIDs = new int[] { };
  ArrayList arrEmpID = new ArrayList();
  int EmpID = 0;
  if (CheckBox1.Checked)
  {
     EmpID = 123;
     arrEmpID.Add(EmpID);
  }
  if (CheckBox2.Checked)
  {
     EmpID = 1234;
     arrEmpID.Add(EmpID);
  }
  if (CheckBox3.Checked)
  {
     EmpID = 1234;
     arrEmpID.Add(EmpID);
  }
  </code></pre>
  
  <p>After all i would like to assign this the <code>EmpIDs</code> which was declared as <code>int array</code></p>
  
  <p>I tried this</p>
  
  <pre><code>for (int i = 0; i &lt; arrEmpID.Count; i++)
      {
          EmpIDs = arrEmpID.ToArray(new int[i]);
      }
  </code></pre>
  
  <p>But i am unable to add can any one help me</p>