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 →

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

Your Own Version of left-pad()

Posted on July 1, 2022 by dgookin
2

Difficulty: ★ ★ ☆ ☆

Padding a string on its left side isn’t that difficult, yet it’s a vital piece of code. To understand why, you need to know that the initialism NPM stands for Node Package Manager. It’s a critical part of the Internet.
Continue reading →

Posted in Exercise | 2 Replies

Introduction to Pipes

Posted on June 25, 2022 by dgookin
Reply

If you’re like me, you’re probably more familiar with the concept of pipes at the command prompt than in a programming environment. Or maybe you don’t care either way. Regardless, both types of pipe are similar forms of communications, but programming pipes seem specifically weird to me.
Continue reading →

Posted in Lesson | Leave a reply

The Thread Must Die!

Posted on June 18, 2022 by dgookin
Reply

A thread ends in one of three ways: natural causes, an early exit, or sudden death. Yes, it’s exciting, but no more than any aspect of programming.
Continue reading →

Posted in Lesson | Leave a reply

Leaving a Thread Early

Posted on June 11, 2022 by dgookin
Reply

Threads in your code go off and do their own thing, running independently from other parts of the code. Still, the thread is established as a function in your source code file. Like any function, it can leave early.
Continue reading →

Posted in Lesson | Leave a reply

The Elevator Ride – Solution

Posted on June 8, 2022 by dgookin
Reply

To code a simulated elevator ride you must know the floor requests, up and down. This is the challenge given for this month’s Exercise, which can either drive you nuts or delight you depending on how you craft your solution.
Continue reading →

Posted in Solution | Leave a reply

Multiple Thread Mania

Posted on June 4, 2022 by dgookin
Reply

In last week’s Lesson, a program spawned a single thread. This thread runs at the same time as the main program, interrupting text input (if you let it). Such fun! But a multithreaded program isn’t limited to running just two threads. Your code can spawn multiple threads, each running simultaneously.
Continue reading →

Posted in Lesson | Leave a reply

Post navigation

← Older posts
Newer posts →

Recent Posts

  • The Ever-Expanding Pointer Array
  • Heron’s Formula – Solution
  • Coding a Better stringcopy() Function
  • Heron’s Formula
  • Copying Strings

Recent Comments

  • dgookin on Heron’s Formula
  • Chris Webb on Heron’s Formula
  • dgookin on Heron’s Formula
  • Chris Webb on Heron’s Formula
  • dgookin on Finding Those Pesky Null Characters!

Meta

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

Copyright © 1997-2025 by QPBC.
All rights reserved

Proudly powered by WordPress