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

Pointers to Multi-Dimension Arrays – Solution

Posted on May 8, 2026 by dgookin
Reply

The challenge for this month’s Exercise is to use pointers to work through a multi-dimensional array. As I mentioned in the exercise post, multi-dimensional arrays are all stored as a single-dimension where the compiler calculates offsets for rows and columns (and more) for you.
Continue reading →

Posted in Solution | Leave a reply

A Little Bit Off the Sides – Solution

Posted on April 8, 2026 by dgookin
5

The C language woefully lacks a trim() or similar string manipulation function. Rather than let it flail in absent envy, your task for this month’s Exercise is to code such a function. The goal is to remove whitespace characters from either end of a string.
Continue reading →

Posted in Solution | 5 Replies

What is the Largest Value – Solution

Posted on March 8, 2026 by dgookin
Reply

Once again, the challenge for this month’s exercise is to unravel a math puzzle. This time, the puzzle reads like this:
Continue reading →

Posted in Solution | Leave a reply

Pulling Numbers from a String – Solution

Posted on February 8, 2026 by dgookin
Reply

This month’s C programming exercise is to extract numbers from a string. Specifically, your task is to code the extract() function that returns the address of a digit found in a string. This function must also be capable of repeat calls to continue locating digits within the same string.
Continue reading →

Posted in Solution | Leave a reply

Is It a “Real” Triangle? – Solution

Posted on January 8, 2026 by dgookin
2

The challenge for this month’s Exercise is to generate three random values and determine if they work as sides of a valid triangle. To make this determination, you must consider three types of triangles and test the generated values for each.
Continue reading →

Posted in Solution | 2 Replies

Which is Greatest? – Solution

Posted on December 8, 2025 by dgookin
Reply

The task for this month’s Exercise is to write a function, greatest(), that returns the largest of three values. While this task could be done easily with an if-else construction, the second part of the challenge is to write the entire thing as a single ternary statement. How’d you do?
Continue reading →

Posted in Solution | Leave a reply

Having Fun with goto – Solution

Posted on November 8, 2025 by dgookin
Reply

This month’s C programming Exercise is probably the most bizarre one I’ve ever offered! Using the goto keyword is frowned upon, which means that your C programmer brain is unaccustomed to thinking about using goto to construct, well, anything!
Continue reading →

Posted in Solution | Leave a reply

Heron’s Formula – Solution

Posted on October 8, 2025 by dgookin
1

The challenge for this month’s Exercise is to code Heron’s Formula. This geometric magic calculates the area of a triangle given the length of each of its three sides.
Continue reading →

Posted in Solution | 1 Reply

The Reversing Words Filter – Solution

Posted on September 8, 2025 by dgookin
2

The task for this month’s C programming Exercise is to code a filter that reverses single words. As a filter, the code deals with standard input and output, but it must store this input in word-sized chunks for the reversing process to work.
Continue reading →

Posted in Solution | 2 Replies

Your Name in Base 36 – Solution

Posted on August 8, 2025 by dgookin
Reply

My solution for this month’s Exercise didn’t require much work. What I did was to “stack overflow” the problem by pulling in functions from earlier Lessons. The only new portion of code deals with processing the input before sending the string off to the b36_decimal() function I’ve already written.
Continue reading →

Posted in Solution | Leave a reply

Post navigation

← Older posts

Recent Posts

  • Ctype Functions: isgraph() and isprint()
  • Ctype Functions: isalnum(), isalpha() and isdigit()
  • Ctype Functions: isupper() and islower()
  • Ctype Functions: toupper() and tolower()
  • Pointers to Multi-Dimension Arrays – Solution

Recent Comments

  • Chris Webb on Ctype Functions: isupper() and islower()
  • M.Stumpfl on Ctype Functions: toupper() and tolower()
  • M.Stumpfl on Ctype Functions: isupper() and islower()
  • dgookin on Ctype Functions: isupper() and islower()
  • dgookin on Ctype Functions: toupper() and tolower()

Meta

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

Copyright © 1997-2026 by QPBC.
All rights reserved

Proudly powered by WordPress