Need some help converting C# method to C++
<p>I am a C# guy who is desperately trying to learn C++ and port some old code over. Been doing OK so far but the following method has me stumped. If anyone could give me some pointers (sorry for pun) I would be grateful.</p>

<p>C# method:  </p>

<pre><code>public static string crappyEncryption(String userKey)    
{    
    StringBuilder eStr = new StringBuilder();    
    String key1 = "somehorriblelongstring";    
    String key2 = "someotherhorriblelongstring";    
    for (int i = 0; i &lt; userKey.Length; i++)   
    {    
        eStr.Append(key2[key1.IndexOf(userKey[i])]);    
    }    
    return encodeTo64(eStr.ToString());    
} 
</code></pre>

<p><code>encodeTo64</code> is a local method which I have solved in C++. This weird method (if you were wondering) was a small encryption method I came up with that we could use mobile cross platform for non-essential string encryption.</p>

<p>Thanks very much</p>
