title: how to put a string into an integer array c++
body: <p>I have a string that contains what ever the user has input </p>
  
  <pre><code>string userstr = "";
  cout &lt;&lt; "Please enter a string ";
  getline (cin, userstr);
  </code></pre>
  
  <p>The string is then stored in userstr, I then want the string to be stored in a integer array where each character is a different element in the array. I have created a dynamic array as the following:</p>
  
  <pre><code>int* myarray = new int[sizeof(userstr)]; 
  </code></pre>
  
  <p>However how do I then get my string into that array?</p>