Note: The scanf() shown as a comment below will still work -- it is just
not how a programmer would do it.
/*wk4ex4.c*/ /*This seems a simple example: you enter a letter and the program repeats the letter and shows its numeric code (ASCII value)
But what is the line:
doing just before the while?
Remove the line and see what happens (a comment below explains it)
To help you, I will tell you that ASCII codes for things like carriage return, new line, and tab are low numbers (under 20)
HINT: an easy way to temporarily remove a statement is to turn it into a comment, so instead of erasing the line make it */
/* This trick is called "commenting out" and is frequently used by programmers.
/*This example is here because the book gives some bad advice. exercise 2 on page 71 suggests using for loops as timing (or time delay) devices. The program below pauses between letters using such a device.
DO NOT DO THIS!
You simply don't know how long the delay will be on different machines. I had to go to one million to get a reasonable delay on my machine. There are many old PC games which are unplayable today because the programmers used this kind of loop for timing a pause or response. On modern machines there is no discernable pause at all! */
/*This introduces the break command. Remember break ends the loop while continue just takes us to the top again.
This page is at: http://testbed.cis.drexel.edu/Cindex4.html