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 →

The Microwave Problem

Posted on February 1, 2022 by dgookin
Reply

Difficulty: Medium

‘
I have a smart microwave oven. Say I need to heat my tea for a minute and a half. I type in 90. When I press the Start button, the 90 transforms into 1:30, a minute thirty. It’s the same quantity of time, but expressed differently. Such magic is merely clever programming.
Continue reading →

Posted in Exercise | Leave a reply

Oops: A (Not Really) 3D Array

Posted on January 29, 2022 by dgookin
Reply

I screwed up some code in a most delightful manner, all without knowing what I did. In fact, it was a student who ran my less-than-brilliant code and discovered the obvious flaw. But I was clueless.
Continue reading →

Posted in Lesson | Leave a reply

My Own strcasecmp() Function – Round Three

Posted on January 22, 2022 by dgookin
Reply

The strcasecmp() function isn’t part of the standard C library, though many compilers feature it. As having the function is handy, I wrote about crafting your own version back in 2019. Alas, that implementation is flawed.
Continue reading →

Posted in Lesson | Leave a reply

A Tally of Unique Words, Part VI

Posted on January 15, 2022 by dgookin
Reply

Any mortal programmer would have stopped with last week’s Lesson, where a tally of unique and duplicate words is output. This is the desired result, right? Yes, but it’s an un-orderly list.
Continue reading →

Posted in Lesson | Leave a reply

Decoding a String – Solution

Posted on January 8, 2022 by dgookin
Reply

Encoding means nothing if you can’t decode, which is the task for this month’s Exercise: Transform the encoded hex bytes back into characters, unwinding the formula used to create them. The challenge isn’t really as much with coding the math as it is with translating hex bytes back into integer values — characters.
Continue reading →

Posted in Solution | Leave a reply

A Tally of Unique Words, Part V

Posted on January 8, 2022 by dgookin
Reply

The next step in the unique words program is to tally the count of each word. From last week’s Lesson, the word list is sorted, which makes the task of counting duplicates easy.
Continue reading →

Posted in Lesson | Leave a reply

Decoding a String

Posted on January 1, 2022 by dgookin
Reply

Difficulty: Medium

The task for last month’s Exercise was to encode a string. As you may have feared, the task for this month’s Exercise is to decode that string. Let me review:
Continue reading →

Posted in Exercise | Leave a reply

A Tally of Unique Words, Part IV

Posted on January 1, 2022 by dgookin
Reply

In our last episode, the unique words code is able to parse and list individual words in the buffer. To find unique and duplicate words, the next step is to sort the list.
Continue reading →

Posted in Lesson | Leave a reply

A Tally of Unique Words, Part III

Posted on December 25, 2021 by dgookin
Reply

From last week’s Lesson, the text in a buffer is parsed, creating pointers to each word in the string. Alas, the addresses of these words (the pointers) aren’t saved, which is stupid. To handle the job, and to keep the Unique Words project moving forward, a dynamic array of pointers must be allocated.
Continue reading →

Posted in Lesson | Leave a reply

A Tally of Unique Words, Part II

Posted on December 18, 2021 by dgookin
Reply

Continuing with my Unique Words project from last week’s Lesson: Once the buffer contains text, the next step is to parse the words: to split the long string of text stored in memory into separate word chunks. For this task, I turn to my old pall, the strtok() function.
Continue reading →

Posted in Lesson | Leave a reply

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Code Page 437
  • Dumping the Screen in W-I-D-E Color
  • Which is Greatest? – Solution
  • Dumping the Screen in Color
  • Which is Greatest?

Recent Comments

  • dgookin on Code Page 437
  • M.Stumpfl on Code Page 437
  • dgookin on Dumping the Screen in W-I-D-E Color
  • M.Stumpfl on Dumping the Screen in Color
  • Chris Webb on Dumping the Screen in W-I-D-E Color

Meta

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

Copyright © 1997-2025 by QPBC.
All rights reserved

Proudly powered by WordPress