
String input is a weird thing when it comes to wide characters, mostly because how the heck do you type wide characters in a terminal window beyond copy-and-paste?
Continue reading

String input is a weird thing when it comes to wide characters, mostly because how the heck do you type wide characters in a terminal window beyond copy-and-paste?
Continue reading

Programming is a fun hobby because once you unlock and open a door, you immediately find another locked door. Normal humans would experience frustration, but a good programmer enjoys a challenge and even sees the humor in the situation. A case in point is learning how to program wide characters in C: Once you think you’ve cleared a huge hurdle, you find another, taller one right behind it.
Continue reading

After you set the necessary locale for your program, you’re free to use the wide character functions defined in the wchar.h header file. For some reason, this process is poorly-documented on the Internet, which is probably why you’re here.
Continue reading

At the dawn of the microcomputer era, lowercase text was considered a big deal. That’s because many home computers at the time displayed only uppercase letters. Memory was tight. Full-ASCII character generators added to the system’s cost. Yes, a microcomputer that displayed lowercase text was a big deal.
Continue reading
Division is the last of the four basic arithmetic operations taught. Addition is easiest, followed by subtraction. Multiplication is merely aggressive addition. Division is a weird un-multiplication combined with subtraction thing, which is probably why educators save the concept for last.
Continue reading

A new operator was added to the C language in the last revision, one that I don’t cover in my books. (I’m not sure how that happened.) Anyway, it’s the Elvis operator. Unless you’re a fan of the ternary operator, you’ll probably never use it.
Continue reading
Last week’s Lesson showed how to shift a column of numbers in an array grid. The array just happens to be a magic square. So the puzzle is to run the array through the confirm_magic() function, which was presented in a previous week’s Lesson. Seems easy.
Continue reading
Before moving off the topic of arrays and their bogus dimensions, I want to play further with a magic square. Specifically, it intrigues me that you can shift rows or columns within the square and it doesn’t affect the magical properties.
Continue reading
Suppose you have an array of integers which represents a magic square: All the rows and columns — even the two diagonals — add to the same total. To prove it, you create a function, confirm_magic() that processes the array and validates the math. You have just one problem . . .
Continue reading
Multi-dimension array notation is just a handy shortcut for you, the human programmer. Internally, an array is a single-file line of values, one marching after another. The dimensional aspect helps humans organize the array’s data, but all that organization is superficial.
Continue reading