My solution for this month’s Exercise generated a list of duplicated letters in a string. The list also includes blank lines. It’s possible to prevent the blank lines from being displayed, but to do so requires extra programming kung fu.
Continue reading
Author Archives: dgookin
Duplicated Letters – Solution
The challenge for this month’s Exercise is to write code that counts repeating letters in a string. For example, the string “Hello, this is a test” repeats the letters T and S three times, letters E, H, I, and L twice, and the letters A and O appear only once.
Continue reading
Ten C Programming Mistakes
I’m certain that more than 10 C programming mistakes are common, but for some reason people enjoy lists with 10 items. My list of Ten C Programming Mistakes isn’t a top-ten list, so nothing is ranked. These are just a collection (cut off at 10) of the problems and issues I find most frequently when coding in the C language.
Continue reading
Duplicated Letters
I’ve been working on a program that counts unique words in a text file. It’s an interesting exercise and explores the larger realm of pattern matching. You can try such scanning on a smaller scale by coding a program that counts the frequency of letters within a string. And that task is presented as this month’s Exercise.
Continue reading
To Split a String in C
Have you ever heard a programmer mock the C language? Recently, a C# programmer informed me that C was okay, but “you can’t even split a string in C in less than 20 lines of code.”
Challenge accepted!
Continue reading
Stupid main() Function Tricks
The main() function is the first C language function you learn to write. It’s required. And you probably know that it has arguments, which are culled from the command prompt and made available to the program. So what stupid stuff can you do with main()?
Continue reading
Let’s Be Assertive
I find it fun to debug code. I add various printf() statements to a program to display values and quickly determine what’s going on. This process seems easier than toiling with a debugger.
Continue reading
Fill My Grid – Solution
The puzzle for this month’s Exercise was to create and fill a 20-by-20 character grid with 20 asterisks placed at random positions, no two asterisks in the same spot. I hope you found this Exercise interesting, but not too easy.
Continue reading
Made-Up File Names
Many moons ago, I coded a file-renaming utility. It allows me to shuffle chapter names for documents used in my books, renaming a whole batch at once without overwriting existing filenames. It couldn’t happen if I didn’t know about the mktemp() function.
Continue reading
Fill My Grid

I’m fascinated by grids. Consider the chessboard, which is a grid. Or think about the most basic game grid, a 3-by-3 array for a game of tic-tac-toe. Programming a grid is a common thing, so your best hope is that this month’s Exercise is yet another super cinchy silly grid program.
Continue reading