Have you ever had your C code run amok and had to press Ctrl+C to cancel?
Yeah, I’ve never had that happen to me either.
Continue reading
Have you ever had your C code run amok and had to press Ctrl+C to cancel?
Yeah, I’ve never had that happen to me either.
Continue reading
A specific command to terminate a program was popular with programming languages long ago. For example, in BASIC you had the END
command, which exited a program. For unusual circumstances, you could use the STOP
command. It was the abnormal termination command, which stopped the program and also generated a “Break in line” message (in GW Basic). I’m sure other early languages also had commands to bail out of a program, and modern languages are the same.
Continue reading
The nifty thing about this month’s Exercise is that so many solutions are available. In fact, I found the challenge engaging because I kept trying to think of other ways to solve the puzzle.
Continue reading
With the dawn of the new year, and my reflection upon the Clock program I blogged about recently, I’ve been thinking about time. Specifically, the time_t data type used with various C library time functions. Can this value contain negative time?
Continue reading
The FizzBuzz problem is quite easy to explain, but not as easy to code because you can go in so many directions. It works like this:
Continue reading
My clock program is almost complete! It generates the current time as output and it updates the current time every minute. The only step remaining is to synchronize the program’s output with the system time. I want to ensure that when the system reads :00 seconds that the program ticks over to the next minute.
Continue reading
From last week’s Lesson, the code I wrote for my clock program outputs the current hour and minute. I also want it to update, to keep running and output the next minute and so on. To me, that’s the difference between a clock program and code that just outputs the current time.
Continue reading
The other day I had this strong urge to write myself a text mode clock program, one that runs at the command prompt. This desire harkens back to my days programming text mode computers: I don’t need a clock, I just wanted to see if I could code one.
Continue reading
I’ve often wondered how it works. The printf() function has one argument minimum, a formatting string. Yet how does the compiler know how many other arguments are required? It’s not really a mystery, once you understand the concept of variable argument lists.
Continue reading
The key to creating a calendar is to know on which day of the week the first of the month falls. This datum can be extrapolated from any other day of the month, as long as you know on which day of the week it falls.
Continue reading