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 →

The Mysterious enum Keyword

Posted on July 11, 2015 by dgookin
Reply

They’re the orphan keywords, urchins, unwanted, unused, unloved. Of the 32 C language keywords, a handful are seldom used. These include: auto, enum, register, union, and volatile.
Continue reading →

Posted in Lesson | Leave a reply

A Fork in Your Code

Posted on July 4, 2015 by dgookin
1

All of the code I’ve written in my books as well as demonstrated on this blog has been single-tasking: The program runs as one process, does one thing, in order, and then terminates. With this Lesson, that streak ends.
Continue reading →

Posted in Lesson | 1 Reply

Know Your Process

Posted on June 27, 2015 by dgookin
Reply

Program. Software. Application. Process. These are all terms that describe different aspects of a similar thing.
Continue reading →

Posted in Lesson | Leave a reply

The Marvelous popen() Function

Posted on June 20, 2015 by dgookin
Reply

To launch and run another program from within your code, use the system() function. When your code must examine or save that program’s output, use the popen() function.
Continue reading →

Posted in Lesson | Leave a reply

Execute and Leave

Posted on June 13, 2015 by dgookin
Reply

The system() function allows you to run one program from within another. If it’s your desire to launch another program and have your program quit, you can immediately follow system() with an exit() function. Or you can go out of your way and use the oddball execl() function.
Continue reading →

Posted in Lesson | Leave a reply

The Joys of Iteration

Posted on June 6, 2015 by dgookin
Reply

Suppose that you’re testing code and need to run a program six times in a row. You could keep repeating the program, running it multiple times, but why not write a utility that does the same thing? That would be a good and practical way to put the system() function to work.
Continue reading →

Posted in Lesson | Leave a reply

Hello, System

Posted on May 30, 2015 by dgookin
Reply

One thing that continues to puzzle me about learning the C language is how frequently beginners use the system() function. Is it a crutch? Is it a necessity? What’s the allure of this function that makes it show up in beginner code?
Continue reading →

Posted in Lesson | Leave a reply

Before You Say Goodbye . . .

Posted on May 23, 2015 by dgookin
Reply

The standard C library contains a lot of interesting and unusual routines. Some can really put the fun into function. One of them I’ve rarely used, but which can be extremely handy, is atexit().
Continue reading →

Posted in Lesson | Leave a reply

Build Your Own strcasestr() Function

Posted on May 16, 2015 by dgookin
Reply

I was a bit surprised the other day. I’d written code on my Macintosh and tried to run it on the PC. Because I usually write generic stuff, I figured that the code would compile and run on both systems. But it didn’t compile.
Continue reading →

Posted in Lesson | Leave a reply

Parsing the Command Line IV

Posted on May 9, 2015 by dgookin
Reply

Command line options often sport their own options or settings. For example, tab width might be set by specifying the tabwidth option followed by a value. No hard and fast rules exist for how such an option is set, but I’ve seen it happen in one of three ways:
Continue reading →

Posted in Lesson | Leave a reply

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Tagging a Union
  • The Clock Angle Problem – Solution
  • The Scary Part of the Union
  • The Clock Angle Problem
  • Back When Unions Were Useful

Recent Comments

  • dgookin on Tagging a Union
  • Chris Webb on Tagging a Union
  • dgookin on The Clock Angle Problem – Solution
  • Chris Webb on The Clock Angle Problem – Solution
  • Chris Webb on The Clock Angle Problem – Solution

Meta

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

Copyright © 1997-2026 by QPBC.
All rights reserved

Proudly powered by WordPress