Skip to primary content
Skip to secondary content

C For Dummies Blog

Main menu

  • C For Dummies (home)
  • History
  • Series
  • Supplemental
  • Blog Miscellany

Post navigation

← Older posts
Newer posts →

Working with Text Files Longer than a Single Line

Posted on October 20, 2018 by dgookin
Reply

Unless your program also created the file it’s reading, you have no guarantee how must text lurks inside. It could be a single character or the entire works of Shakespeare. Dealing with an unknown quantity of text it a file-reading challenge.
Continue reading →

Posted in Lesson | Leave a reply

File Writing and Reading

Posted on October 13, 2018 by dgookin
Reply

Sending text to standard output is something you learn with your first C program. The common functions are putchar(), puts(), printf(), and so on. When you explore file access, you’ll find familiarity in those functions because they’re quite similar to the standard I/O functions.
Continue reading →

Posted in Lesson | Leave a reply

Initial Caps – Solution

Posted on October 8, 2018 by dgookin
2

The solution for this month’s Exercise is perhaps a bit trickier than you may have anticipated. The issue is to set the first letter of a word as upper case and the remaining letters lowercase. The solution I devised involves reading two characters at a time.
Continue reading →

Posted in Solution | 2 Replies

A File Outta Nowhere

Posted on October 6, 2018 by dgookin
Reply

I had such a struggle with file I/O when I first learned computer programming. I knew what a file was and how to create it in an application. With computer programming, however, you enter a lower-level realm that requires more knowledge of file access.
Continue reading →

Posted in Lesson | Leave a reply

Initial Caps

Posted on October 1, 2018 by dgookin
Reply

A filter is a program that accepts standard input and generates standard output. These programs are fun to write, providing you have a goal in mind and some way to manipulate the incoming text in a manner that’s significant enough to notice in the output.
Continue reading →

Posted in Exercise | Leave a reply

Fun with Preprocessor Names

Posted on September 29, 2018 by dgookin
Reply

Your probably familiar with the #include and #define preprocessor directives. You may know a few more, which come in handy for certain coding issues. I have a page on this blog, which goes over some of the common directives, but it doesn’t cover them all. Specifically, it doesn’t cover the preprocessor names.
Continue reading →

Posted in Lesson | Leave a reply

Recursively Plowing a Directory Tree

Posted on September 22, 2018 by dgookin
Reply

The code to recursively plow a directory tree presented in last week’s Lesson could be improved upon. Primarily, it relies upon the .. shortcut to jump back to the parent directory. This method works only some of the time.
Continue reading →

Posted in Lesson | Leave a reply

Directory Spelunking

Posted on September 15, 2018 by dgookin
Reply

Exploring a folder tree — I mean directory tree — is a procedure found in many file and media utilities. From an original directory, you scan the list of files looking for a subdirectory. When it’s found, you open it and recursively continue the scan.
Continue reading →

Posted in Lesson | Leave a reply

Pulling a Directory

Posted on September 8, 2018 by dgookin
Reply

O how well I remember DOS. It wasn’t Unix, but it cribbed from Unix heavily. One of the popular DOS commands was DIR, which was like the shell command ls, but more primitive. A typical DOS directory listing looked something like this:
Continue reading →

Posted in Lesson | Leave a reply

Shuffle That Playlist – Solution

Posted on September 8, 2018 by dgookin
Reply

The solution to this month’s Exercise is similar to code I’ve presented in my books and in this blog with regards to randomly drawing from a fixed set of elements. Yet it has an extra level of complexity.
Continue reading →

Posted in Solution | Leave a reply

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Obtaining the Averages
  • Extracting Data Chunks
  • C Blog 13th Anniversary
  • Colorful Data Chunks
  • A Little Bit Off the Sides – Solution

Recent Comments

  • dgookin on C Blog 13th Anniversary
  • M.Stumpfl on C Blog 13th Anniversary
  • Chris Webb on C Blog 13th Anniversary
  • M.Stumpfl on A Little Bit Off the Sides – Solution
  • dgookin on A Little Bit Off the Sides – Solution

Meta

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

Copyright © 1997-2026 by QPBC.
All rights reserved

Proudly powered by WordPress