title: Pointers and the New Operator
body: <p>I'm working on an exercise and can't seem to figure out what's going wrong. The prompt reads, "The variable cp_arr has been declared as an array of 26 pointers to char. Allocate 26 character values, initialized to the letters 'A' through 'Z' and assign their pointers to the elements of cp_arr (in that order)."</p>
  
  <p>Edit: this post was flagged as a duplicate to a post involving pointers and strings, this isn't the same issue.</p>
  
  <p>While testing the code, this is what I've come up with, but the output isn't exactly what I was expecting.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
      char next = 'A';
      char* cp_arr[26];
      for (int i = 0; i &lt; 26; i++)
      {
          cp_arr[i] = new char(next);
          cout &lt;&lt; cp_arr[i] &lt;&lt; endl;
          next++;
      }
      system("pause");
  }
  </code></pre>