It’s all come to this: Gathering up the individual functions necessary to code a program that outputs the current month, formatted, with the proper number of days for February. Coincidentally, this post is published in February.
Continue reading
Category Archives: Lesson
The Month Program, Phase IV
Last week’s Lesson demonstrates a pretty decent calendar program. It works for every month of the year that has 31 days. Obviously that’s not every month, so more fine tuning must be done, especially to deal with the variable number of days in February.
Continue reading
The Month Program, Phase III
With an algorithm that properly returns the first day of the month, the next step in creating a calendar is to display that first week, and then all subsequent weeks. Sounds easy, right?
Continue reading
The Month Program, Phase II
To create a calendar, you start with the first day of the month. Knowing which weekday is the first of the month is vital to your success.
Continue reading
The Month Program, Phase I
Unix features a handy command line tool called cal. When typed by its lonesome, cal spits up a text calendar on the terminal window. Or you can follow cal with a month and year value to see a specific month, or just the year value to see a year’s calendar. It’s nifty!
Continue reading
Build Your Own String
I can think of three rules for concocting your own string in the C language.
Continue reading
That Terminating \0
Text stored on a computer consists of various displayable characters and perhaps some control codes, such as a tab (\t) or the newline (\n). The string has a starting point, but determining where and how the string ends differs depending on what is storing or reading the string.
Continue reading
The Time I Won The Programming Contest
It was a simple contest: Write code that displays the first 100 prime numbers. The person who wrote the fastest code won.
Continue reading
Variable Tab Width, Part II
Last week’s Lesson discussed the tab character and how it’s used to line up text in a terminal window. This Lesson shows you how such a calculation is made and coded.
Continue reading
Variable Tab Width, Part I
The tab character, 0x08 or ^I (Control-I), is always the same width, no?
Continue reading