title: How to add a name field for a shop database (OOP/C++)
body: <p>Ok, so I've made a database type program and created an item number and price field. I've also tried to stick to a primary key by using the index values of the array of both the "item number" field and "price". But was wondering how to add an "Item name" field along with this to make it work. I've tried to think of many different ways of adding a char type array but that doesn't really work.</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  class shop
  {
      private:
          int i,n, item[20];
          float price[20];
      public:
          void input();
          void output();
  };
  void shop::input()
  {
      cout&lt;&lt;"Enter the number of items: ";
      cin&gt;&gt;n;
      for (i = 1; i &lt;= n; i++)
      {
          cout &lt;&lt; "Enter the item number of the " &lt;&lt; i &lt;&lt; " item: ";
          cin &gt;&gt; item[i];
          cout &lt;&lt; "Enter the price of the item: ";
          cin &gt;&gt; price[i];
      }
  
  }
  void shop::output()
  {
      for (i = 1; i &lt;= n; i++)
      {
          cout &lt;&lt; "Item Number: " &lt;&lt; item[i] &lt;&lt; endl;
          cout &lt;&lt; "Price: " &lt;&lt; price[i] &lt;&lt; endl &lt;&lt; endl;
      }
  }
  void main()
  {
      class shop s;
      s.input();
      s.output();
  }
  </code></pre>