title: If statement still going through when my condition should be false
body: <p>I am attempting to write a Caesar encryption program. I have written two functions.</p>
  <p>The first (sanitize) allows me to make sure that all strings are fully capitalized, here is the source code.</p>
  <pre><code>string sanitize(string message) {
  
      for(int i; i &lt; message.length(); i++){
          message[i] = toupper(message[i]);
      }
  
      return message;
  }
  </code></pre>
  <p>The second (caesar) encrypts the message given. Here is the source code for that as well.</p>
  <pre><code>string caesar(string c_message, char direction) {
  
      if (direction = 'R') {
          for(int j; j &lt; c_message.length(); j++) {
              if((int)c_message[j] + 3 &gt; 90) {
                  c_message[j] = (char)(64 + (3 - (90 - (int)c_message[j])));
              } else {
                  c_message[j] = (char)((int)c_message[j] + 3);
              }
          } 
      } else if (direction = 'L') {
          for(int i; i &lt; c_message.length(); i++) {
              if((int)c_message[i] - 3 &lt; 65) {
                  c_message[i] = (char)(91 - (3 - ((int)c_message[i] - 65)));
              } else {
                  c_message[i] = (char)((int)c_message[i] - 3);
              }            
  
          }
      } else {
          cout &lt;&lt; &quot;directions: 'L' or 'R'&quot; &lt;&lt; endl;
      }
  
    
  
      return c_message;
  }
  </code></pre>
  <p>An example of execution :</p>
  <pre><code>int main(){
      cout &lt;&lt; sanitize(&quot;HELLO&quot;) &lt;&lt; &quot; &quot; &lt;&lt; (char)3 &lt;&lt; endl;
      cout &lt;&lt; caesar(&quot;HELLO&quot;, 'L') &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  <p>The first if statement works, but the second does not.</p>