title: C++ error - returning a char array
body: <p>Consider the following code:</p>
  
  <pre><code>char CeaserCrypt(char str[256],int key)
  {
      char encrypted[256],encryptedChar;
      int currentAsci;
  
      encrypted[0] = '\0'; 
  
      for(int i = 0; i &lt; strlen(str); i++) 
      {
          currentAsci = (int)str[i];
          encryptedChar = (char)(currentAsci+key);
          encrypted[i] = encryptedChar;
      }
  
      return encrypted;
  }
  </code></pre>
  
  <p>Visual Studio 2010 gives an error because the function returns an array. What should I do?</p>
  
  <p>My friend told me to change the signature to <code>void CeaserCrypt(char str[256], char encrypted[256], int key)</code>. But I don't think that is correct. How can I get rid of the compile error?</p>