What's wrong with my string reversal function? (C#)
<pre><code>char[] a = { 'o', 'r', 'a', 'n', 'g', 'e' };

for (int i = 0; i &lt; a.Length/2; i++)
{        
  a[i] = (char)(((uint)a[i])|((uint)a[a.Length-(i+1)]));
  a[a.Length-(i+1)] = (char)(((uint)a[i])^((uint)a[a.Length-(i+1)]));
  a[i] = (char)(((uint)a[i])^((uint)a[a.Length-(i+1)]));
}
</code></pre>

<p>I know how to implement this using standard .NET functionality and temp vars. I am just curious what specifically I am doing wrong in the above example that causes it not to work when the following works fine:</p>

<pre><code>int a = 5;
int b = 10;

a = a | b;
b = a ^ b;
a = a ^ b;
</code></pre>

<p>Isn't the above string version just a series of those?</p>
