title: Array of char arrays C++
body: <p>I am writing an exchange program and I have a char array that holds another 6 char arrays. The program works fine except for one thing: when I try to print the arrays' values, it prints only the first letter.</p>
  
  <p>Maybe the code isn't right, but I didn't find another way to make this exchange. Actually I think the problem is in pointers that point to that arrays, but again I am not sure.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;fstream&gt;
  #include &lt;stdlib.h&gt;
  using namespace std;
  
  int main(int argc, char* argv[])
  {
    cout&lt;&lt;"EXCHANGE POKEMON:"&lt;&lt;endl;
  char a[100]="PIKACHU", b[100]="CHARMELEON", c[100]="GEODUDE", d[100]="GYARADOS", e[100]="BUTTERFREE", f[100]="MANKEY", tmp[100];
  char t[6] = {*a,*b,*c,*d,*e,*f};
  
  while(1)
  {
    for(int i = 0; i &lt; 6; i++)
    {
      cout &lt;&lt; i &lt;&lt; ") " &lt;&lt; t[i] &lt;&lt;endl;
    }
  
    cout&lt;&lt;endl&lt;&lt;"Choose a pokemon:";
  
    int x, y;
    cin&gt;&gt;x;
  
    if(x == -1)
    {
      exit(0);
    }
    cout &lt;&lt; "Choose a pokemon to exchange with:";
    cin&gt;&gt;y;
  
    *tmp = t[x];
    t[x] = t[y];
    t[y] = *tmp;
    }
  }
  </code></pre>