Yesterday

Difficulty: ★ ★ ☆ ☆

The time.h header defines a handful of functions useful for discovering and manipulating today’s date. Especially the localtime() function, which translates a time_t (Unix Epoch) value into date fields for output or manipulation. It’s a wonderful tool, but what does it tell you about yesterday?
Continue reading

A Compact for Loop

Difficulty: ★ ★ ☆ ☆

A for loop statement contains three parts: initialization, termination, and while-looping. If you omit any part, the compiler assumes the value one, or TRUE, as the value, so the statement for(;;) becomes an endless loop. The opposite of omitting is loading up: You can state multiple initialization and while-looping expressions in the statement, which can make a for loop truly compact.
Continue reading

Cyclops Numbers

Difficulty: ★ ★ ★ ☆

Oh, leave it to the propeller heads to devise a clever and fun name for something the rest of us never pay attention to. This time it’s a cyclops number, which is any decimal integer value with an odd number of digits and a big fat zero in the middle — like a cyclops’ eye.
Continue reading