title: filling a char array with a string? c++
body: <p>I need to fill this array via user prompt. I was thinking to read in the user entry to a string and then assign that string to the array but that doesn't seem to be the right way to approach this. Could someone help me out?</p>
  
  <p>The error I'm receiving reads "array type array[100] is not assignable"</p>
  
  <pre><code>    #include &lt;iostream&gt;
      #include &lt;cstdlib&gt;
      #include &lt;ctime&gt;
      #include &lt;string.h&gt;
  
      using namespace std;
  
      int main()
      {
          string theString;
  
          char array[100]; // ARRAY MAX SIZE
  
          int length = sizeof(array)-1;
          char * ptrHead = array;
          char *ptrTail = array + length - 1;
  
  
          //USER PROMPTS &amp; ARRAY FILL
          cout &lt;&lt; "Please enter a string to be reverse: " &lt;&lt; endl;
          cin &gt;&gt; theString;
          array= theString;
  
          //WHILE LOOP SWAPPING CHARACTERS OF STRING
          while (ptrHead &lt; ptrTail)
          {
              char temp = *ptrHead;
              *ptrHead = *ptrTail;
              *ptrTail = temp;
  
              ptrHead++;
              ptrTail--;
          }
  
          cout &lt;&lt; array &lt;&lt; endl;
  
          return 0;
      }
  </code></pre>