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 →

Converting Month Strings to Integers

Posted on August 13, 2022 by dgookin
3

I saw this problem on stackoverflow: How can you take a month string and convert it into an integer value, one through 12? The student submitting the query used a long if-else if-else construction. I have a better idea.
Continue reading →

Posted in Lesson | 3 Replies

From ‘A’ and ‘a’ to ‘Z’ and ‘z’ – Solution

Posted on August 8, 2022 by dgookin
Reply

I don’t believe one definitive solution exists for this month’s Exercise: Output a string of upper- and lowercase letters. No, the challenge is more to discover different insights a coder has to a specific problem.
Continue reading →

Posted in Solution | Leave a reply

Going Mad for Mod

Posted on August 6, 2022 by dgookin
Reply

I have two questions when it comes to using the % operator: Is it modulus or modulo? And which value comes first?
Continue reading →

Posted in Lesson | Leave a reply

From ‘A’ and ‘a’ to ‘Z’ and ‘z’

Posted on August 1, 2022 by dgookin
Reply

Difficulty: ★ ☆ ☆ ☆

Here’s an easy exercise to try, something for those first learning C programming but also a challenge for experienced users: Output the alphabet A to Z in both upper and lowercase letters. It’s an “easy” exercise only when you don’t explore the possibilities.
Continue reading →

Posted in Exercise | Leave a reply

Forcing a Decision

Posted on July 30, 2022 by dgookin
5

Programs often ask questions: yes-or-no and multiple choice. The user must select one of the given options, which I refer to as forcing a decision. Your goal as programmer is to pester the user to input a valid choice.
Continue reading →

Posted in Lesson | 5 Replies

Returning a Non-Static String

Posted on July 23, 2022 by dgookin
Reply

It’s possible to return a string created in a function without declaring it static. This trick requires some understanding of how functions return values. Nerd alert!
Continue reading →

Posted in Lesson | Leave a reply

Having Fun with the getline() Function

Posted on July 16, 2022 by dgookin
Reply

In last week’s post, I updated information I had originally written about the useful getline() function. The topic is worthy of further exploration, specifically with the mechanics behind the function’s internal allocation — and reallocation — of memory.
Continue reading →

Posted in Lesson | Leave a reply

The getline() Function – Update

Posted on July 9, 2022 by dgookin
2

Back in early 2015, I wrote about the getline() function, which is a handy way to read a string. I’ve been informed that my post is the top result for a Google search on getline() — and I have an update!
Continue reading →

Posted in Lesson | 2 Replies

Your Own Version of left-pad() – Solution

Posted on July 8, 2022 by dgookin
Reply

Can you write your own left-pad function in C? Would you get so angry that you’d pull it from the Jenga-tower NPM and bring the Internet to its knees? I hope your answer Yes to the first question and No to the second, because your task for this month’s Exercise is to write that function.
Continue reading →

Posted in Solution | Leave a reply

Chatting with a Thread

Posted on July 2, 2022 by dgookin
Reply

A launched thread can be passed an argument, similar to any function. And the thread can return a value, just like any function. But while the thread runs, options for communications are rather limited.
Continue reading →

Posted in Lesson | Leave a reply

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Two File Descriptors?
  • Duping a File in the Raw
  • Ramanujan Nested Radicals – Solution
  • Rubbing a File Raw
  • Ramanujan Nested Radicals

Recent Comments

  • dgookin on Ramanujan Nested Radicals – Solution
  • Chris Webb on Ramanujan Nested Radicals – Solution
  • Chris Webb on Ramanujan Nested Radicals – Solution
  • Chris Webb on Ramanujan Nested Radicals
  • dgookin on Ramanujan Nested Radicals

Meta

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

Copyright © 1997-2026 by QPBC.
All rights reserved

Proudly powered by WordPress