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 →

Nested Processing – Solution

Posted on July 8, 2020 by dgookin
5

This month’s Exercise wasn’t astronomically difficult, but I did spend some time devising a solution. My goal was to try to avoid writing a nested loop. This goal proved unattainable.
Continue reading →

Posted in Solution | 5 Replies

What Size Integer?

Posted on July 4, 2020 by dgookin
Reply

Things were stable back in the old days. When I first coded C, a char was 8-bits (a byte), and an int was 16-bits. The short was also 16-bits and the long, it was truly long at 32-bits. Today, things aren’t as consistent.
Continue reading →

Posted in Lesson | Leave a reply

Nested Processing

Posted on July 1, 2020 by dgookin
4

After a few intermediate to advanced Exercises, I decided to try something that’s a little easier this month. Still, even if you’re a pro, it helps to pull back and try something basic just to see what you can do with it.
Continue reading →

Posted in Exercise | 4 Replies

I/O in [Almost] Any Base

Posted on June 27, 2020 by dgookin
Reply

After climbing the ternary I/O mountain, and crafting functions that both input and output base 3 values, the next step is obvious: Combine both functions into a single program. The step after that is less obvious: Change the code so that any base can be used to process input or generate output.
Continue reading →

Posted in Lesson | Leave a reply

Eating Ternary Input

Posted on June 20, 2020 by dgookin
Reply

I’m happy I chose to write the function that consumes a ternary value last, shown in last week’s Lesson. The process turns out to be not that big of a deal, though trepidations scurried around me as I wrote the code.
Continue reading →

Posted in Lesson | Leave a reply

The ternary_out() Function

Posted on June 13, 2020 by dgookin
Reply

I believe my approach was okay for generating ternary (base 3) numbers, but for some reason I couldn’t get my algorithm to work. From last week’s Lesson, here’s what I tried:
Continue reading →

Posted in Lesson | Leave a reply

Getting to Euler’s Number – Solution

Posted on June 8, 2020 by dgookin
Reply

The challenge for this month’s Exercise is not only to calculate Euler’s number, e, but to count how many loops a program must endure before your e value calculation matches the defined constant M_E. I hope you didn’t find this challenge too difficult.
Continue reading →

Posted in Solution | Leave a reply

Dreaming of the ternary_out() Function

Posted on June 6, 2020 by dgookin
Reply

To generate a string of digits representing a value in a specific power base, such as base 3 (ternary), you need a power table. Using this power table, you can translate any positive integer into a string representation of the number in the given base. Sounds complex. Is complex.
Continue reading →

Posted in Lesson | Leave a reply

Getting to Euler’s Number

Posted on June 1, 2020 by dgookin
6

I enjoy reading about and studying mathematics. One of my favorite books is A History of π. I’ve used this book to inspire my Pi Day (March 14) programs. It’s fascinating stuff.
Continue reading →

Posted in Exercise | 6 Replies

Powers of Three

Posted on May 30, 2020 by dgookin
4

When the math nerds refer to a counting system, they use the word base. “We count in base 10,” they proclaim, adding, “Decimal” to sound important. Surely, these are the miracles of mathematics.
Continue reading →

Posted in Lesson | 4 Replies

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