Simple password hashing program c++ : <p>Im trying to add the output together. So instead of the output being 12 I want it to be 3, but I have no idea how to. Help is much appreciated. </p>

<pre><code>int returnVal(char x)
{
return x - 96;
}


int main() {
string s = "ab";

for (int i = 0; i &lt; s.length(); i++)
{
    cout &lt;&lt; returnVal(s[i]);    
}

return 0;
}
</code></pre>
