title: Converting chars to binary in C++
body: <p>I wrote this and when I launch it, it gives me all the posibilities. I want it to just give me the one that corresponds with my char I've typed in. Can you tell me what's wrong here?
  Thanks in advance.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;conio.h&gt;
  using namespace std;
  
  int main()
  {
  char letter='b';
  while(letter!='end')
  {
      cout&lt;&lt;"What is the letter you wanna convert?"&lt;&lt;endl;
      cin &gt;&gt; letter;
      if(letter='A') {cout&lt;&lt;"01000001"&lt;&lt;endl;}
      if(letter='B') {cout&lt;&lt;"01000010"&lt;&lt;endl;}
      if(letter='C') {cout&lt;&lt;"01000011"&lt;&lt;endl;}
      if(letter='D') {cout&lt;&lt;"01000100"&lt;&lt;endl;}
      if(letter='E') {cout&lt;&lt;"01000101"&lt;&lt;endl;}
      if(letter='F') {cout&lt;&lt;"01000110"&lt;&lt;endl;}
      if(letter='G') {cout&lt;&lt;"01000111"&lt;&lt;endl;}
      if(letter='H') {cout&lt;&lt;"01001000"&lt;&lt;endl;}
      if(letter='I') {cout&lt;&lt;"01001001"&lt;&lt;endl;}
      if(letter='J') {cout&lt;&lt;"01001010"&lt;&lt;endl;}
      if(letter='K') {cout&lt;&lt;"01001011"&lt;&lt;endl;}
      if(letter='L') {cout&lt;&lt;"01001100"&lt;&lt;endl;}
      if(letter='M') {cout&lt;&lt;"01001101"&lt;&lt;endl;}
      if(letter='N') {cout&lt;&lt;"01001110"&lt;&lt;endl;}
      if(letter='O') {cout&lt;&lt;"01001111"&lt;&lt;endl;}
      if(letter='P') {cout&lt;&lt;"01010000"&lt;&lt;endl;}
      if(letter='Q') {cout&lt;&lt;"01010001"&lt;&lt;endl;}
      if(letter='R') {cout&lt;&lt;"01010010"&lt;&lt;endl;}
      if(letter='S') {cout&lt;&lt;"01010011"&lt;&lt;endl;}
      if(letter='T') {cout&lt;&lt;"01010100"&lt;&lt;endl;}
      if(letter='U') {cout&lt;&lt;"01010101"&lt;&lt;endl;}
      if(letter='V') {cout&lt;&lt;"01010110"&lt;&lt;endl;}
      if(letter='W') {cout&lt;&lt;"01010111"&lt;&lt;endl;}
      if(letter='X') {cout&lt;&lt;"01011000"&lt;&lt;endl;}
      if(letter='Y') {cout&lt;&lt;"01011001"&lt;&lt;endl;}
      if(letter='Z') {cout&lt;&lt;"01011010"&lt;&lt;endl;}
  
      if(letter='a') {cout&lt;&lt;"01100001"&lt;&lt;endl;}
      if(letter='b') {cout&lt;&lt;"01100010"&lt;&lt;endl;}
      if(letter='c') {cout&lt;&lt;"01100011"&lt;&lt;endl;}
      if(letter='d') {cout&lt;&lt;"01100100"&lt;&lt;endl;}
      if(letter='e') {cout&lt;&lt;"01100101"&lt;&lt;endl;}
      if(letter='f') {cout&lt;&lt;"01100110"&lt;&lt;endl;}
      if(letter='g') {cout&lt;&lt;"01100111"&lt;&lt;endl;}
      if(letter='h') {cout&lt;&lt;"01101000"&lt;&lt;endl;}
      if(letter='i') {cout&lt;&lt;"01101001"&lt;&lt;endl;}
      if(letter='j') {cout&lt;&lt;"01101010"&lt;&lt;endl;}
      if(letter='k') {cout&lt;&lt;"01101011"&lt;&lt;endl;}
      if(letter='l') {cout&lt;&lt;"01101100"&lt;&lt;endl;}
      if(letter='n') {cout&lt;&lt;"01101110"&lt;&lt;endl;}
      if(letter='o') {cout&lt;&lt;"01101111"&lt;&lt;endl;}
      if(letter='p') {cout&lt;&lt;"01110000"&lt;&lt;endl;}
      if(letter='q') {cout&lt;&lt;"01110001"&lt;&lt;endl;}
      if(letter='r') {cout&lt;&lt;"01110010"&lt;&lt;endl;}
      if(letter='s') {cout&lt;&lt;"01110011"&lt;&lt;endl;}
      if(letter='t') {cout&lt;&lt;"01110100"&lt;&lt;endl;}
      if(letter='u') {cout&lt;&lt;"01110101"&lt;&lt;endl;}
      if(letter='v') {cout&lt;&lt;"01110110"&lt;&lt;endl;}
      if(letter='w') {cout&lt;&lt;"01110111"&lt;&lt;endl;}
      if(letter='x') {cout&lt;&lt;"01111000"&lt;&lt;endl;}
      if(letter='y') {cout&lt;&lt;"01111001"&lt;&lt;endl;}
      if(letter='z') {cout&lt;&lt;"01111010"&lt;&lt;endl;}
      getche();
  }
  return 666;
  </code></pre>
  
  <p>}</p>