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 →

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

Parsing the Command Line III

Posted on May 2, 2015 by dgookin
Reply

Your code must consider whether or not command line options are present, that the user may type the options in any order, and that some or all of the option could be incorrect. That makes for a lot of processing, but it’s also forgiving and users prefer the flexibility.
Continue reading →

Posted in Lesson | Leave a reply

Parsing the Command Line II

Posted on April 25, 2015 by dgookin
Reply

When processing the main() function’s arguments, you must keep in mind the possibilities. Options are, after all, options. They might be there, they might not.
Continue reading →

Posted in Lesson | Leave a reply

Parsing the Command Line I

Posted on April 18, 2015 by dgookin
Reply

About a year ago, I wrote a post on reading the command line arguments. It’s a process that takes place all the time, not only when running programs in a terminal window but also for graphical operating systems. Knowing how to manipulate command line arguments is important.
Continue reading →

Posted in Lesson | Leave a reply

Quicksorting Strings, Pointer Edition

Posted on April 11, 2015 by dgookin
Reply

I’ll confess that when I use a quicksort to sort and array of strings, I don’t use the C Library’s qsort() function. No, I write my own. The problem is that when sorting an array of strings, the qsort() function’s compar argument is a pain in the butt to craft properly.
Continue reading →

Posted in Lesson | Leave a reply

Quicksorting Strings

Posted on April 4, 2015 by dgookin
Reply

The quicksort deftly handles vast quantities of values. It can also sort strings, but that’s where things can get weird.
Continue reading →

Posted in Lesson | Leave a reply

Inside the Quicksort

Posted on March 28, 2015 by dgookin
Reply

The Internet is littered with plenty of good explanations of how the quicksort works. The definition at Wikipedia graphically illustrates the process, which is commonly called “divide and conquer.” I’ve stolen the Wikipedia illustration and placed it into Figure 1.
Continue reading →

Posted in Lesson | Leave a reply

The Quicksort

Posted on March 21, 2015 by dgookin
Reply

Computers excel at searching and sorting. That, and they can occasionally screw up a phone bill.
Continue reading →

Posted in Lesson | Leave a reply

Sorting It All Out

Posted on March 14, 2015 by dgookin
Reply

Computers are good at performing repetitive tasks; doing the same boring nonsense over and over. Two great examples are searching and sorting.
Continue reading →

Posted in Lesson | Leave a reply

Other Ways to Fetch the CWD

Posted on March 7, 2015 by dgookin

In last week’s Lesson I mentioned the constant, MAXPATHLEN. Like PATH_MAX, it returns the size of the maximum number of characters allowed in a pathname. Unlike PATH_MAX, however, MAXPATHLEN is defined in the sys/param.h header file, not limits.h.
Continue reading →

Posted in Lesson

Post navigation

← Older posts
Newer posts →

Recent Posts

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

Recent Comments

  • dgookin on Reading Raw Input
  • Chris Webb on Reading Raw Input
  • dgookin on Is It a “Real” Triangle? – Solution
  • Chris Webb on Is It a “Real” Triangle? – Solution
  • dgookin on A Colorful Hexdump

Meta

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

Copyright © 1997-2026 by QPBC.
All rights reserved

Proudly powered by WordPress