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 →

My Own Square Root Funtion

Posted on July 25, 2020 by dgookin
Reply

From last week’s Lesson, I plowed into a BASIC programming book I worked on 35 years ago. (Yes, I’m old.) In it, substitute code was offered for commands not available in every version of BASIC. To appreciate this necessity, understand that back in those days computers weren’t file-to-file compatible, so translating programming language dialects was part of the job.
Continue reading →

Posted in Lesson | Leave a reply

Getting to the Square Root of the Problem

Posted on July 18, 2020 by dgookin
1

The first part of my writing career began by updating a computer book bestseller, The BASIC Handbook. This tome served as a lexicon for the various BASIC programming language dialects, allowing users from one version of BASIC to translate and use code from another version.
Continue reading →

Posted in Lesson | 1 Reply

The gettimeofday() Function

Posted on July 11, 2020 by dgookin
2

Every so often I scour C library references, looking for fun or unusual functions. When I find one I’m unfamiliar with or something I’ve seldom used, I write about. After all, the functions do practical things that might be worthy of exploration. A recent example is gettimeofday().
Continue reading →

Posted in Lesson | 2 Replies

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

Post navigation

← Older posts
Newer posts →

Recent Posts

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

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