title: Display letters in 8x8 characters
body: <p>I'm looking to modify this code so that it can display the output into 8x8 characters. For example if I type "gotcha", the output should be "GOTCHA" and if I type numbers the output will space character. I don't know how to use if,else statement for each letter of input. Right now I only use <code>if</code>-<code>else</code> statement for letter "a","A","b","B". And one more, can I use <code>void</code> for <code>char_led display[]</code>.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstring&gt;
  using namespace std;
  
  int main()
  {
      int a, b;
      char c;
      char led_display[] =
      {
          0x3c, 0x24, 0x24, 0x7e, 0x62, 0x62, 0x62, 0x00,//A
          0x7c, 0x24, 0x24, 0x3e, 0x32, 0x32, 0x7e, 0x00,//B
          0x3e, 0x22, 0x20, 0x60, 0x60, 0x62, 0x7e, 0x00,//C
          0x7e, 0x22, 0x22, 0x32, 0x32, 0x32, 0x7e, 0x00,//D
          0x3e, 0x20, 0x20, 0x78, 0x60, 0x60, 0x7e, 0x00,//E
          0x3e, 0x20, 0x20, 0x78, 0x60, 0x60, 0x60, 0x00,//F
          0x3e, 0x22, 0x20, 0x6e, 0x62, 0x62, 0x7e, 0x00,//G
          0x24, 0x24, 0x24, 0x7e, 0x62, 0x62, 0x62, 0x00,//H
          0x3e, 0x08, 0x08, 0x18, 0x18, 0x18, 0x3E, 0x00,//I
          0x1c, 0x08, 0x08, 0x0C, 0x0C, 0x4C, 0x7c, 0x00,//J
          0x24, 0x24, 0x28, 0x70, 0x68, 0x68, 0x66, 0x00,//K
          0x20, 0x20, 0x20, 0x60, 0x60, 0x62, 0x7e, 0x00,//L
          0x36, 0x3e, 0x2a, 0x62, 0x62, 0x62, 0x62, 0x00,//M
          0x32, 0x2a, 0x2a, 0x6a, 0x6a, 0x66, 0x62, 0x00,//N
          0x3e, 0x22, 0x22, 0x62, 0x62, 0x62, 0x7e, 0x00,//O
          0x3e, 0x22, 0x22, 0x7e, 0x60, 0x60, 0x60, 0x00,//P
          0x3e, 0x22, 0x22, 0x62, 0x6a, 0x64, 0x7a, 0x00,//Q
          0x3e, 0x22, 0x22, 0x7e, 0x68, 0x64, 0x66, 0x00,//R
          0x3c, 0x24, 0x20, 0x3c, 0x0c, 0x4c, 0x7c, 0x00,//S
          0x3e, 0x08, 0x08, 0x18, 0x18, 0x18, 0x18, 0x00,//T
          0x22, 0x22, 0x22, 0x62, 0x62, 0x62, 0x7e, 0x00,//U
          0x22, 0x22, 0x22, 0x64, 0x68, 0x70, 0x60, 0x00,//V
          0x22, 0x22, 0x22, 0x6a, 0x6a, 0x7e, 0x76, 0x00,//W
          0x42, 0x24, 0x18, 0x3c, 0x64, 0x64, 0x66, 0x00,//X
          0x66, 0x24, 0x14, 0x0c, 0x0c, 0x18, 0x30, 0x00,//Y
          0x7e, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x7e, 0x00,//Z
          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//1
      };
  
      char letter[10];
      cout &lt;&lt; "Enter a string &lt;max. 9 letter&gt;: ";
      cin.getline(letter, 10);
  
      for (int i = 0; i &lt; strlen(letter); i++)
      {
          char ch = letter[i];
          ch = toupper(letter[i]);
          cout &lt;&lt; " " &lt;&lt; ch;
  
          if ((strcmp(letter, "a") == 0) || (strcmp(letter, "A") == 0))
          {
              for (a = 0; a &lt; 8; a++)
              {
                  cout &lt;&lt; endl;
  
                  for (b = 0; b &lt; 8; b++)
                  {
                      c = led_display[a] &gt;&gt; (7 - b) &amp; 1;
  
                      if (c == 0)
                      {
                          cout &lt;&lt; " ";
                      }
                      else
                      {
                          cout &lt;&lt; char{ 0xDB };
                      }
                  }
              }
          }
          else if ((strcmp(letter, "b") == 0) || (strcmp(letter, "B") == 0))
          {
              for (a = 8; a &lt; 16; a++)
              {
                  cout &lt;&lt; endl;
  
                  for (b = 0; b &lt; 8; b++)
                  {
                      c = led_display[a] &gt;&gt; (7 - b) &amp; 1;
  
                      if (c == 0)
                      {
                          cout &lt;&lt; " ";
                      }
                      else
                      {
                          cout &lt;&lt; char{ 0xDB };
                      }
                  }
              }
          }
      }
  
      return 0;
  }
  </code></pre>