{"id":4895,"date":"2021-08-01T00:01:04","date_gmt":"2021-08-01T07:01:04","guid":{"rendered":"https:\/\/c-for-dummies.com\/blog\/?p=4895"},"modified":"2021-08-08T08:22:33","modified_gmt":"2021-08-08T15:22:33","slug":"a-handy-ascii-table","status":"publish","type":"post","link":"https:\/\/c-for-dummies.com\/blog\/?p=4895","title":{"rendered":"A Handy ASCII Table"},"content":{"rendered":"<h2>Difficulty: Easy<\/h2>\n<p>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.<br \/>\n<!--more--><br \/>\nI&#8217;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.<\/p>\n<div id=\"attachment_4913\" style=\"width: 560px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4913\" src=\"https:\/\/c-for-dummies.com\/blog\/wp-content\/uploads\/2021\/08\/0801-figure1.png\" alt=\"ASCII table\" width=\"550\" height=\"507\" class=\"size-full wp-image-4913\" srcset=\"https:\/\/c-for-dummies.com\/blog\/wp-content\/uploads\/2021\/08\/0801-figure1.png 550w, https:\/\/c-for-dummies.com\/blog\/wp-content\/uploads\/2021\/08\/0801-figure1-300x277.png 300w, https:\/\/c-for-dummies.com\/blog\/wp-content\/uploads\/2021\/08\/0801-figure1-325x300.png 325w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><p id=\"caption-attachment-4913\" class=\"wp-caption-text\">Figure 1. ASCII table output, including decimal, octal, hex, and character values.<\/p><\/div>\n<p>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&#8217;s this month&#8217;s Exercise:<\/p>\n<p>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&#8217;s character values, however, are output as traditional control characters (^ means &#8220;control&#8221; in early nerd). If the actual characters were output, they would mess up the display.<\/p>\n<p>Ensure that your output has a title row, as shown in Figure 1. Use pipe characters to separate the major columns.<\/p>\n<p>Please try this Exercise on your own before you look at <a href=\"https:\/\/c-for-dummies.com\/blog\/?p=4910\">my solution<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Write code to generate a handy ASCII table, packed with all sorts of goodness. <a href=\"https:\/\/c-for-dummies.com\/blog\/?p=4895\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-4895","post","type-post","status-publish","format-standard","hentry","category-exercise"],"_links":{"self":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4895","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4895"}],"version-history":[{"count":8,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4895\/revisions"}],"predecessor-version":[{"id":4936,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4895\/revisions\/4936"}],"wp:attachment":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4895"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4895"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}