title: Segmentation Fault in loops C++
body: <p>I'm running into a problem here with segmentation faults.  </p>
  
  <p>Here is the code: </p>
  
  <pre><code>string CipherMessage::VigDecipher(string key)
  {
      int keyValue;
      int charValue;
      string textInit = m_text;
  
      // Initializes an array containing the alphabet. A=index 0, B=index 1, etc
      string alphabet[26] = "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O"\
                             "P","Q","R","S","T","U","V","W","X","Y","Z"};
  
      // keyValues contains the values of each term of the multi-character key.
      int keyValues[6];
  
      // Enters the keyValues into the array.
      for (int i=0; i&lt;key.length(); i++){
          for (int j=0; i&lt;=25; j++){
              if (key[i] == ALPHABET[j])
                  keyValues[i] = j;
          }
      }
      return m_text_new;
  }
  </code></pre>
  
  <p>It just gives me the segmentation fault. </p>