title: Caesar Cipher using char * ? c++
body: <p>So i am trying to use the Ceasar Cipher with <code>char *</code>'s, I've written a simple function out like this:</p>
  
  <pre><code>char * Encrypt(char * s, int k)
  {
      char * c = s;
  
      for(int i = 0; i &lt; strlen(s); i++)
         c[i] += k;
  
      return c;
  } 
  </code></pre>
  
  <p>that seems to look like it should work but it doesn't. It throws an error when running program.</p>
  
  <p>Here is an example of how i call this function:</p>
  
  <pre><code>int main()
  {
      cout &lt;&lt; Encrypt("hello", 2) &lt;&lt; endl;
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>And before you say "why not just use <code>string</code>?", well the answer is I'm writing C++ on a certain SDK that causes compiler errors when using <code>string</code>. Ok but yeah, any form of help will greatly be appreciated, thanks!</p>