Every coder needs an ASCII table. Even back in the old days, when I memorized such things as the Escape character was equal to 27 decimal, 0x1b hex, and had the keyboard shortcut ^[, I would glance at the ASCII table poster hanging on the wall to confirm that I was using the proper values in my code. And the poster looked cool.
I’m curious what happened to my old ASCII poster. It got lost in a move somewhere along my travels. Regardless, when I want to view an ASCII table today, I run a program that outputs the codes and character values, similar to what you see in Figure 1.
Having the ASCII table is handy for me even today. And it can be handy for you, providing you code a program that generates output the same as shown in Figure 1. That’s this month’s Exercise:
Generate an ASCII table. The table is displayed in four columns or sticks, as shown in Figure 1. Each stick shows decimal, octal, hex, and character values. The first stick’s character values, however, are output as traditional control characters (^ means “control” in early nerd). If the actual characters were output, they would mess up the display.
Ensure that your output has a title row, as shown in Figure 1. Use pipe characters to separate the major columns.
Please try this Exercise on your own before you look at my solution.