title: How to extend arrays in C#
body: <p>I have to do an exercise using arrays. The user must enter 3 inputs (each time, information about items) and the inputs will be inserted in the array. Then I must to display the array.</p>
  
  <p>However, I am having a difficult time increasing the array's length without changing the information within it; and how can I allow the user to enter another set of input? This is what I have so far:</p>
  
  <pre><code>public string stockNum;
  public string itemName;
  public string price;
  
  string[] items = new string[3];
  
  public string [] addItem(string[] items)
  {
      System.Console.WriteLine("Please Sir Enter the stock number");
      stockNum = Console.ReadLine();
      items.SetValue(stockNum, 0);
      System.Console.WriteLine("Please Sir Enter the price");
      price = Console.ReadLine();
      items.SetValue(price, 1);
      System.Console.WriteLine("Please Sir Enter the item name");
      itemName = Console.ReadLine();
      items.SetValue(itemName, 2);
      Array.Sort(items);
      return items;
  }
  
  
  public void ShowItem()
  {
      addItem(items);
      Console.WriteLine("The stock Number is " + items[0]);
      Console.WriteLine("The Item name is " + items[2]);
      Console.WriteLine("The price " + items[1]);
  }
  
  static void Main(string[] args)
  {
      DepartmentStore depart = new DepartmentStore();
      string[] ar = new string[3];
      // depart.addItem(ar);
      depart.ShowItem();
  }
  </code></pre>
  
  <p>So my question boils down to:</p>
  
  <ol>
  <li><p>How can I allow the user to enter more than one batch of input?
  For example, the first time the user will enter the information about item ( socket number, price and name), but I need to allow the user enter more information about another item?</p></li>
  <li><p>How can I display the socket num, price and name for each item in the array based on the assumption that I have more than one item in the array?</p></li>
  </ol>