>> DAVID J. MALAN: Let's refine our printing of ASCII characters just a
little bit.
Because characters are simply numbers underneath the hood, it turns out that
even within our looping construct we can actually iterate not only over
just ints, but also over the chars themselves.
>> In other words, I could tell the computer to start iterating from A up
through Z rather than even have to know more or deal with the equivalence
of A being 65 and Z being 90.
In other words, I can reimplement this program as follows.
>> For char, let's call it c, equals.
And now I'd like to start iterating when the character equals quote,
unquote, A. And notice the single quotes.
This is indeed a single character and not a one character string.
>> Semicolon.
Let's iterate so long as c is less than or equal to capital Z, also
single quoted.
And on each iteration of this loop, let's increment c itself.
Because again, at the end of the day, c is just a number
underneath the hood.
And so we can also manipulate it as such.
>> Now inside this loop, let's print out that percent i is percent
c, backslash n.
And plug in now for i the result of casting c, a char, to an int, followed
by c itself.
>> Semicolon.
Save my file.
And let's compile and run.
Make ASCII 1 dot slash ASCII 1.
And, scrolling back up, we see that 65 is again A, 66 is again B, and all the
way down to 90 is again Z.