One of the things I dread in my books, is foisting the scanf() function upon a beginner. I have no way around this frustration.
Continue reading
Author Archives: dgookin
Initializing an Array

Like all variables in C, arrays are declared uninitialized. They contain whatever junk already exists in memory. Initializing an array is therefore important. It can be done in one of three ways: as it’s declared, in a loop, or as it’s used in the code.
Continue reading
The 21 Number Game

I occasionally visit Rosetta Code to look for C language inspiration. The site offers a programming puzzle, then presents solutions in various languages. A recent challenge involved the 21 number game — but the C language had no solution!
Continue reading
The switch Condition

A switch-case structure performs a complex decision in your code, similar to a cascade of if else-if else statements. The structure works like a comparison as a whole, acting upon single values or variables. But its construction need not lack expressions.
Continue reading
Multiples of Four – Solution
The solution this month’s Exercise isn’t that complex, but it was handy in disproving a theory.
Continue reading
Digits of Significance
In last week’s Lesson, I lamented that C lacks a function to compare two floating point values based on a significant number of digits. Being a C programmer, I resolved this issue by writing a function that accomplishes this suddenly necessary task.
Continue reading
Multiples of Four
![]()
I enjoy playing number games. I’m not good at it, but I enjoy playing them. Recently such a game piqued my curiosity enough to consider it for my monthly C For Dummies exercise: 21
Continue reading
My Own Square Root Funtion
From last week’s Lesson, I plowed into a BASIC programming book I worked on 35 years ago. (Yes, I’m old.) In it, substitute code was offered for commands not available in every version of BASIC. To appreciate this necessity, understand that back in those days computers weren’t file-to-file compatible, so translating programming language dialects was part of the job.
Continue reading
Getting to the Square Root of the Problem
The first part of my writing career began by updating a computer book bestseller, The BASIC Handbook. This tome served as a lexicon for the various BASIC programming language dialects, allowing users from one version of BASIC to translate and use code from another version.
Continue reading
The gettimeofday() Function
Every so often I scour C library references, looking for fun or unusual functions. When I find one I’m unfamiliar with or something I’ve seldom used, I write about. After all, the functions do practical things that might be worthy of exploration. A recent example is gettimeofday().
Continue reading