title: Pointer pointing to a string pointer array in C++
body: <p>I have a pointer array of strings: </p>
  
  <pre><code>string *names = new string[numOfNames];
  </code></pre>
  
  <p>That array is then populated with values from a file. I am trying to sort the names alphabetically so I am trying to assign another pointer array to the address of each individual element names is pointing to. So I want to do something like this:</p>
  
  <pre><code>string *namesPtr = new string[numOfNames];
  namesPtr[0] = &amp;names[0];
  </code></pre>
  
  <p>However I am getting a red squiggly on the equal sign saying </p>
  
  <blockquote>
    <p>no operator "=" matches these operands, operand types are std::string = std::string*</p>
  </blockquote>
  
  <p>I have a pointer array of names because numOfNames will be specified in the file I am going to open and from my understanding, a regular array won't work because I have to specify the number of elements in the array.</p>