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: Lesson

Post navigation

← Older posts
Newer posts →

Using make to Build Projects

Posted on September 30, 2023 by dgookin
2

The make utility has been around since the early days of Unix. This tool is designed to create large projects by compiling and linking files based on dependencies. It takes care of a lot problems managing multi-module files to streamline the build process.
Continue reading →

Posted in Lesson | 2 Replies

Memory-File Multi-Module Implementation

Posted on September 23, 2023 by dgookin
Reply

At 205 lines of code in last week’s Lesson, my memory-file project is getting larger by the day. At some point, the source code files must be broken out into separate modules, then compiled and linked separately. This is how I handle all large projects when it becomes too unwieldly to edit everything in a single file.
Continue reading →

Posted in Lesson | Leave a reply

Enabling Random Memory-File Access

Posted on September 16, 2023 by dgookin
Reply

The two types of file access are sequential and random. Sequential access means the file’s data is read from beginning to end, one byte after the other. Random access isn’t random in the sense that it’s haphazard. No, random access means you can read data from any position in the file: beginning, middle, or end.
Continue reading →

Posted in Lesson | Leave a reply

Reading and Writing to Memory-Files

Posted on September 9, 2023 by dgookin
Reply

Opening and closing a memory-file is just academic. To make the whole shebang work, you must be able to read and write data.
Continue reading →

Posted in Lesson | Leave a reply

Opening and Closing Memory-Files

Posted on September 2, 2023 by dgookin
Reply

To treat a chunk of memory as a file, it must be “opened” and a handle returned for future file reference and interaction. Likewise, the memory-file must be “closed” when you no longer need it. To accomplish these tasks, I’ve crafted the mem_open() and mem_close() functions.
Continue reading →

Posted in Lesson | Leave a reply

Memory Files

Posted on August 26, 2023 by dgookin
2

In the Unix environment, everything is a file. For example, you can open the terminal as a file, which I covered in a previous Lesson. But what about memory? Can you open memory as a file? And why would you want to?
Continue reading →

Posted in Lesson | 2 Replies

The camelCase to snake_case Conversion with Proper Memory Allocation

Posted on August 19, 2023 by dgookin
2

With all the storage available in a modern computer, it’s easy — and often perfectly okay — to be overly generous when allocating memory. Still, the old coder in me has a lingering desire to save every byte possible. So when it comes to crafting a solution for this month’s Exercise, my desire is to be byte stingy.
Continue reading →

Posted in Lesson | 2 Replies

A Better camelCase to snake_case Conversion

Posted on August 12, 2023 by dgookin
Reply

My solution for this month’s Exercise took some terrible assumptions. First, that the strings are merely output and not stored. Second, that the strings are perfectly formed camelCase and snake_case. In this Lesson, I address the first concern.
Continue reading →

Posted in Lesson | Leave a reply

Using scanf() to Build a String – Part V

Posted on August 5, 2023 by dgookin
Reply

In my code update for last week’s Lesson, I used return statements to send strings back to the main() function. This technique works — only once, even though the strings are declared static in the token() function.
Continue reading →

Posted in Lesson | Leave a reply

Using scanf() to Build a String – Part IV

Posted on July 29, 2023 by dgookin
Reply

I refer to the process of converting special characters into strings as tokenizing. The token is a character or string — a code. This code is translated into something else, which allows the program to deal with complex items in a simple manner.
Continue reading →

Posted in Lesson | Leave a reply

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Cooked or Raw?
  • Is It a “Real” Triangle? – Solution
  • Getting and Setting the File Position Indicator
  • Is It a “Real” Triangle?
  • A Colorful Hexdump

Recent Comments

  • dgookin on Is It a “Real” Triangle? – Solution
  • Chris Webb on Is It a “Real” Triangle? – Solution
  • dgookin on A Colorful Hexdump
  • Chris Webb on A Colorful Hexdump
  • dgookin on Code Page 437

Meta

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

Copyright © 1997-2026 by QPBC.
All rights reserved

Proudly powered by WordPress