Skip to primary content
Skip to secondary content

C For Dummies Blog

Main menu

  • C For Dummies (home)
  • History
  • Series
  • Supplemental
  • Blog Miscellany

Author Archives: dgookin

Post navigation

← Older posts
Newer posts →

C Blog 9th Anniversary

Posted on April 13, 2022 by dgookin
Reply

The first post on this blog was made on April 13, 2013.

Posted in Uncategorized | Leave a reply

Color Text, Part II

Posted on April 9, 2022 by dgookin
Reply

From last week’s Lesson, I showed how ANSI codes are used to set color text in terminal output. It’s time to go nuts showing the possibilities.
Continue reading →

Posted in Lesson | Leave a reply

The Babylonian Square Root – Solution

Posted on April 8, 2022 by dgookin
2

Hammurabi
I was blown away by the elegance and simplicity of the Babylonian Method to calculate a square root, which is the topic of this month’s Exercise. I only hope that my solution lives up the challenge, lest I suffer the fate of the Assyrians.
Continue reading →

Posted in Solution | 2 Replies

Color Text, Part I

Posted on April 2, 2022 by dgookin
Reply

Your C programs’ text output need not be so dull. Aside from adding wide characters, you can spice things up with color text. The terminal flavor is what determines the color palette. All you need to know are the secret codes that activate and deactivate the attributes.
Continue reading →

Posted in Lesson | Leave a reply

The Babylonian Square Root

Posted on April 1, 2022 by dgookin
Reply

Hammurabi

Difficulty: ★ ★ ★ ☆

When I sought to write my own square root function back in 2020, I based it on a series of steps from the math.com website. I figured, “Hey! These guys are math nerds. They know their stuff.” Turns out, the ancient Babylonians beat them to the punch — and have a better method for calculating a square root.
Continue reading →

Posted in Exercise | Leave a reply

Accessing the Printer in C

Posted on March 26, 2022 by dgookin
Reply

Back in the old days, the printer was a device wired to the computer and handled directly by whatever program wanted to use it. Printing in C involved opening the printer device and sending the data. Today, things work differently.
Continue reading →

Posted in Lesson | Leave a reply

Initializing a Buffer – Your Own memset() Function

Posted on March 19, 2022 by dgookin
Reply

As I wrote in last week’s Lesson, the C23 standard renders the memset() function — a standard C library function for over 30 years — obsolete. If you want to initialize a buffer, you can use the secure memset_s() or just initialize the buffer manually or with your own memset()-like function.
Continue reading →

Posted in Lesson | Leave a reply

The Perils of the memset() Function

Posted on March 12, 2022 by dgookin
2

While researching the upcoming — and significant — C23 version of the C programming language, I learned something surprising: The memset() function will be deprecated. It effectively does nothing when used in the C23 standard. The reason makes a lot of sense.
Continue reading →

Posted in Lesson | 2 Replies

Simplifying Fractions – Solution

Posted on March 8, 2022 by dgookin
3

This month’s Exercise both terrified and enticed me. Yes, I code these solutions myself after I think up the challenges. No cheating here! This particular puzzle was more fun than I imagined, but also required a lot of mental work.
Continue reading →

Posted in Solution | 3 Replies

How Many Characters Output – So Far?

Posted on March 5, 2022 by dgookin
2

I doubt any C programmer has memorized all of the printf() function’s placeholders, options, and settings. It’s a character salad of interesting and weird things. One of the strangest has to be the %n placeholder.
Continue reading →

Posted in Lesson | 2 Replies

Post navigation

← Older posts
Newer posts →

Recent Posts

  • The Ever-Expanding Pointer Array
  • Heron’s Formula – Solution
  • Coding a Better stringcopy() Function
  • Heron’s Formula
  • Copying Strings

Recent Comments

  • dgookin on Heron’s Formula
  • Chris Webb on Heron’s Formula
  • dgookin on Heron’s Formula
  • Chris Webb on Heron’s Formula
  • dgookin on Finding Those Pesky Null Characters!

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 1997-2025 by QPBC.
All rights reserved

Proudly powered by WordPress