Watch the Stock Market

Difficulty: Medium

Stock prices fluctuate throughout the day based on news, fear, and speculation. If you own stock and desire the price to rise, you anxiously watch the stock tickers throughout the day, puzzled or delighted by the reactions. This month’s Exercise attempts to emulate such anxiety.
Continue reading

Wild About Wildcards

Wildcards were highly useful during the glory days of text mode operating systems. They still exist: ? represents a single character in a filename and * represents a group of characters. Using wildcards to manipulate files is a staple of computer file management, perhaps a lost art in the era of graphical operating systems, but still relevant. The C language is also still relevant, so how does it deal with wildcards in a filename?
Continue reading

The _Generic Keyword

The C11 standard added the “underscore” bunch to the C language’s traditional keywords:

_Alignas
_Alingof
_Atomic
_Bool
_Complex
_Generic
_Imaginary
_Noreturn
_Static_assert
_Thread_local

I don’t routinely use any of these in my programs, beyond trying a few out to see how they work. The _Bool keyword comes in handy. The rest? Well, they’re worth exploring from a curiosity standpoint. For this week’s Lesson, I reveal the mysteries of the _Generic keyword.
Continue reading