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 →

Parsing and Converting

Posted on February 6, 2021 by dgookin
2

The goal stated in last week’s Lesson is to convert a date formatted in a filename string into a time_t value. The filename string must be scanned for expected year, month, and date values. This process involves a custom function, convert(), as well as the strtol() function to translate strings of digits into long int values.
Continue reading →

Posted in Lesson | 2 Replies

A Pair of Arrays

Posted on February 1, 2021 by dgookin
Reply

Removing redundancies from your C code may not be your first goal, but it’s something you can definitely find later. One example is when you must initialize a pair of arrays. Why use two loops when one will do?
Continue reading →

Posted in Exercise | Leave a reply

It’s Parsing Time

Posted on January 30, 2021 by dgookin
Reply

A recent puzzle presented itself, one where I must extract a date based on a file’s name. The date is part of the name, but my code required I translate the date into a time_t value. It’s an awesome programming puzzle that involves many different tricks.
Continue reading →

Posted in Lesson | Leave a reply

The 27th International Obfuscated C Code Contest

Posted on January 23, 2021 by dgookin
Reply

The results of the 27th International Obfuscated C Code Contest were announced earlier this month. The code is amazing. It runs. It’s horrifyingly cryptic.
Continue reading →

Posted in Lesson | Leave a reply

Compiler Options in Code::Blocks

Posted on January 16, 2021 by dgookin
Reply

Like all IDEs, Code::Blocks is effectively a front for the clang, minGW, or gcc compiler lurking somewhere under its skin. While you don’t use these command line tools directly, you can control their options and settings from within the IDE.
Continue reading →

Posted in Lesson | Leave a reply

Compiler Options at the Command Prompt

Posted on January 9, 2021 by dgookin
3

The traditional C compiler is cc. Its GNU replacement in the Linux world is gcc. A better option is the LLVM clang compiler. As commands typed at a prompt, you control these compilers by setting command line options or switches.
Continue reading →

Posted in Lesson | 3 Replies

Find the Most Factors – Solution

Posted on January 8, 2021 by dgookin
Reply

The challenge for this month’s Exercise is to discover those values in the range 1 to 999 that have the highest number of factors. Never mind the math! Let C and the computer do the work for you.
Continue reading →

Posted in Solution | Leave a reply

Emulating the foreach Keyword

Posted on January 2, 2021 by dgookin
Reply

In last week’s Lesson, I covered how to obtain the number of elements in an array. This process is the first step to emulating the foreach keyword in the C language.
Continue reading →

Posted in Lesson | Leave a reply

Find the Most Factors

Posted on January 1, 2021 by dgookin
Reply

If given a pad, pencil, and a factor problem years ago, I would have found doing anything else in the world more exciting. Math is not my forte, yet it remains a curiosity. Especially with The Power Of The Computer, performing math exercises is more of an interesting challenge than a mental ordeal.
Continue reading →

Posted in Exercise | Leave a reply

In Search of the foreach Keyword

Posted on December 26, 2020 by dgookin
Reply

C has three looping keywords: do, for, and while. These keywords construct a block of statements that repeat, hopefully but not necessarily with a terminating condition. Other programming languages offer additional looping keywords, including the popular and useful foreach.
Continue reading →

Posted in Lesson | Leave a reply

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Colorful Data Chunks
  • A Little Bit Off the Sides – Solution
  • Working with Data Chunks
  • A Little Bit Off the Sides
  • From Decimal to Fraction

Recent Comments

  • dgookin on A Little Bit Off the Sides – Solution
  • Jack Bolt on A Little Bit Off the Sides – Solution
  • dgookin on Working with Data Chunks
  • Chris Webb on Working with Data Chunks
  • M.Stumpfl on From Decimal to Fraction

Meta

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

Copyright © 1997-2026 by QPBC.
All rights reserved

Proudly powered by WordPress