title: What is the idea behind ^= 32, that converts lowercase letters to upper and vice versa?
body: <p>I was solving some problem on codeforces. Normally I first check if the character is upper or lower English letter then subtract or add <code>32</code> to convert it to the corresponding letter. But I found someone do <code>^= 32</code> to do the same thing. Here it is: </p>
  
  <pre><code>char foo = 'a';
  foo ^= 32;
  char bar = 'A';
  bar ^= 32;
  cout &lt;&lt; foo &lt;&lt; ' ' &lt;&lt; bar &lt;&lt; '\n'; // foo is A, and bar is a
  </code></pre>
  
  <p>I have searched for an explanation for this and didn't find out. So why this works? </p>