Skip to primary content
Skip to secondary content

C For Dummies Blog

Main menu

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

Category Archives: Solution

Post navigation

← Older posts
Newer posts →

Dump That File! – Solution

Posted on March 8, 2020 by dgookin
Reply

I’ve been coding hexdump utilities since the microcomputer era. They’re just so handy, especially when writing structures or other formatted data to a file. The dump assists with debugging, and it helps you figure out some undocumented data structures as well.
Continue reading →

Posted in Solution | Leave a reply

Automated Guessing Game – Solution

Posted on February 8, 2020 by dgookin
Reply

In the climatic scene of the movie Wargames, the WOPR computer plays Tic-Tac-Toe. A question is asked, “Can the computer play itself?” This postulation forms the basis of all computer learning, but that wasn’t the puzzle for this month’s Exercise.
Continue reading →

Posted in Solution | Leave a reply

Remove Trailing Blank Lines – Solution

Posted on January 8, 2020 by dgookin
Reply

The problem with snipping blank lines from the end of a file is storing the file as it’s processed. At least that’s the issue I faced as I worked through my solution to this month’s Exercise.
Continue reading →

Posted in Solution | Leave a reply

Morse Code Filter – Solution

Posted on December 8, 2019 by dgookin
3

A Morse Code filter probably has no practical use, but it’s a good programming exercise. The issue is how to deal with undefined character codes and otherwise present the output. My solution for this month’s Exercise involves interpreting standard input, discarding undefined information, and sending the results to standard output in a format that isn’t ugly.
Continue reading →

Posted in Solution | 3 Replies

The Yorn Function – Solution

Posted on November 8, 2019 by dgookin
Reply

The most difficult thing about this month’s Exercise is to deal with stream input: When the user overstuffs the input buffer, those extra characters continue to flow into the program, interpreted as additional input and they make the output look ugly.
Continue reading →

Posted in Solution | Leave a reply

Know Your GPA – Solution

Posted on October 8, 2019 by dgookin
2

It’s fun supplying your own scores for a semester, which really helps boost your GPA! Still, the challenge for this Month’s Exercise was to input — and validate — a series of grades to calculate your GPA for five courses.
Continue reading →

Posted in Solution | 2 Replies

Next Tuesday – Solution

Posted on September 8, 2019 by dgookin
2

One way to discover next Tuesday’s date is just to wait. You could code that solution in C, which would be silly, but I hope that you instead chose to use some time functions to derive your answer.
Continue reading →

Posted in Solution | 2 Replies

Rotate the Grid – Solution

Posted on August 8, 2019 by dgookin
Reply

The challenge for this month’s Exercise is to fill a grid with random letters, a to z, then rotate that grid on its side, counterclockwise, and display the results. Such fun.
Continue reading →

Posted in Solution | Leave a reply

Write Your Own Integer Conversion – Solution

Posted on July 8, 2019 by dgookin
3

This month’s Exercise is to emulate the antique atoi() function, which converts a string of digits into an integer value.
Continue reading →

Posted in Solution | 3 Replies

Parse and Count Words in a String – Solution

Posted on June 8, 2019 by dgookin
Reply

The key to making this month’s Exercise work isn’t to know when a word stops, but when the separator characters stop. That’s because words aren’t always separated by single characters.
Continue reading →

Posted in Solution | Leave a reply

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Accessing the Mouse in a Terminal Window
  • Storing and Interpreting Mouse Input
  • Where is the Mouse?
  • Pulling Numbers from a String – Solution
  • What is the Mouse Doing?

Recent Comments

  • dgookin on Reading Raw Input
  • Chris Webb on Reading Raw Input
  • dgookin on Is It a “Real” Triangle? – Solution
  • Chris Webb on Is It a “Real” Triangle? – Solution
  • dgookin on A Colorful Hexdump

Meta

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

Copyright © 1997-2026 by QPBC.
All rights reserved

Proudly powered by WordPress