In last week’s Lesson, I waxed on about how a text message can be concealed in a delightful manner, making it not look like a text message at all. To get to that point, you must write some code that translates plain text into the values desired.
Continue reading
Category Archives: Lesson
Cryptic Text Encoding
Typing in sample code was all the rage back when I first learned assembly language. The programs were short. Most of them I could understand based on my limited knowledge, but I still enjoyed seeing the result and wondering how they did it. Hopefully, I’d learn something.
Continue reading
Long Lines
If I were well-versed in a handful of programming languages, I’m sure I’d find one better than C for examining line lengths in a text file. Perhaps Perl could do the trick? or even the shell language? Regardless, I know C.
Continue reading
Find the Vowel
I admit that sometimes I need to see someone else’s code before a formerly obscure function becomes useful to me. A case in point is the strchr() function, which I rarely use.
Continue reading
Macros Galore!
In last week’s Lesson, I demonstrated how macros can save time, effectively replacing one-line functions in your code. One place I’ve used macros in my own code is when performing binary math operations.
Continue reading
Macros or Functions
In C, a macro is a preprocessor directive that creates a shortcut, often a one-line expression to be inserted elsewhere in the code. Macros can make code more readable, but they can have a negative effect when implemented in a clumsy manner.
Continue reading
Locale Settings Dear to You
The setlocale() function, mentioned in last week’s Lesson, both returns the current locale string and sets a new locale. It’s not necessary to call this function to gather locale details already known to your computer. To pluck out this detail, use the localeconv() function.
Continue reading
Don’t be a Stranger to the Locale
A major hurdle in computer science was getting disparate computers to speak with each other. Not verbally, of course, but by exchanging files in compatible file formats. After this task was ironed out, professionals in white lab coats realized the next step was massaging program output to match the user’s language and other local preferences.
Continue reading
Fetching the Search Path
The search path is a list of directories in which the operating system scans for programs. Its purpose is to allow quick access to common programs and system utilities without the necessity of typing a full pathname or changing to the right directory to start an application.
Continue reading
Building a Format String
In the printf() function, the first argument is a format string. It can contain the various percent placeholders to represent values expressed in the remaining arguments. But can one of those arguments also contain placeholders?
Continue reading