title: Comparing char in c++
body: <p>This is my text file that I'm taking data from</p>
  
  <pre><code>10
  wood      8
  gold      7
  silver    5
  gold      9
  wood      1
  silver    1
  silver    9
  wood      3
  gold      5
  wood      7
  </code></pre>
  
  <p>I'm supposed to find goods with the same name and add all of their amounts, so final result should be wood=19; gold=21; silver=15. This is what I did so far</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  
  using namespace std;
  
  int main()
  {
      ifstream read("data.txt");
      int n;
      read &gt;&gt; n;
      char name[10][n]; // 10 symbols are given for items name
      int amount[n];
      for(int i=0; i&lt;n; i++)
      {
      read.ignore(80, '\n');
      read.get(name[i], 10);
      read &gt;&gt; amount[i];
      }
  
  for(int i=0; i&lt;n; i++)
  {
      for(int d=1; d&lt;n; d++)
      {
      if(name[i]==name[d] &amp;&amp; i!=d)
      {
  
      }
      }
  }
      return 1;
  }
  </code></pre>
  
  <p>Problem so far is that <code>name[i]==name[d]</code> doesn't react even is for example <code>name[i]="wood"</code> and <code>name[d]="wood"</code></p>