title: Simple cipher stops working in loop
body: <p>For the first run around, the cipher will encrypt the string.  But if I want to loop through again, I can't get the cipher to encrypt a second string.</p>
  
  <p>Is there was a way to make this possible without using pointers?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  char checkSum[63] = "QAZXSWEDCVFRTGBNHYUJMKIOLPqazxswedcvfrtgbnhyujmkiolp1234567890"; //checksum
  string message; //original message
  string messageEncrypted; //replaces pointer
  char YorN;
  //int multiplier; //part of the prototype
  
  int main(int argc, char *argz[])
  {
  
  
      do
      {
          cout &lt;&lt; "enter a message to encrypt: ";
          getline(cin, message);
          messageEncrypted = message; //i could use a pointer for this i think but I keep running into problems
  
          for (unsigned count = 0; count &lt;= messageEncrypted.length(); count++) //cycles through characters in string
          {
  
              //multiplier = messageEncrypted.length() + (int)messageEncrypted[count]; //declaring prototype
              //messageEncrypted[count] = (int)messageEncrypted[count] * multiplier; //prototyped idea that doesn't work
  
              while ((int)messageEncrypted[count] &gt; 62) //checks to make sure it is withen the value range of checkSum
              {
                  messageEncrypted[count] -= ('A' - 3); //puts it into that range
              }
  
              messageEncrypted[count] = checkSum[(int)messageEncrypted[count]]; //redeclares character
  
          }
  
          cout &lt;&lt; "Encrypted message is: \n" &lt;&lt; messageEncrypted &lt;&lt; endl; //prints out encrypted message
          cout &lt;&lt; "\nRun again [y/n] ";
          cin &gt;&gt; YorN;
  
      } while (YorN == 'y'||YorN=='Y');
      return 0;
  }
  </code></pre>