C

C Blog

C Programming

Tiny C Projects

NCurses

XML and JSON

Curl

Online Training

C For Dummies Blog

Main menu

Skip to primary content
Skip to secondary content
  • Home
  • Blog Miscellany
    • History
    • Registration
    • Posting Code in a Comment
  • Supplemental
    • Preprocessor Directives
    • Command Line Programming
  • Series

Category Archives: Lesson

Post navigation

← Older posts

Counting Terminal Rows and Columns

Posted on February 4, 2023 by dgookin
Reply

I enjoy programming a computer the old fashioned way, in the text mode terminal window. Yes, it’s now a sad little “app” floating on a graphical screen. This burden doesn’t remove the charm, but it does raise an interesting issue when you try to get text mode output just right: How many rows and columns are there in the terminal window?
Continue reading →

Posted in Lesson | Leave a reply

Checking the CPU Clock

Posted on January 28, 2023 by dgookin
Reply

The clock() function has nothing to do with human time. Nope. It returns a value from the computer’s CPU, the processor time. You can use this value to determine the amount of time it takes your programs to run.
Continue reading →

Posted in Lesson | Leave a reply

Not Every Compiler Likes Your Code

Posted on January 21, 2023 by dgookin
Reply

You would think that the various C compilers deal with C code in the same manner. After all, they adhere to the same C standards, right? This compatibility makes it possible to compile and cleanly build C programs regardless of which compiler you use, right? Well, maybe not.
Continue reading →

Posted in Lesson | Leave a reply

The volatile Keyword

Posted on January 14, 2023 by dgookin
Reply

Perhaps the most hilarious keyword in the C language is volatile. It’s a data type qualifier, which I discussed in last week’s Lesson. But this qualifier doesn’t mean that the data is unstable or risky to use, unlike other things described as “volatile.”
Continue reading →

Posted in Lesson | Leave a reply

Type Qualifiers: const and restrict

Posted on January 7, 2023 by dgookin
Reply

When describing data, the C language offers data types and data qualifiers. The data type is well known to any C programmer, defining the kind of data stored: char, int, float, and so on. The qualifier describes additional aspects of the data, such as how it’s used or whether the compiler should optimize the data’s storage.
Continue reading →

Posted in Lesson | Leave a reply

A Character-to-String Function

Posted on December 31, 2022 by dgookin
Reply

Modern programming languages have libraries rich with routines, functions, and methods — plenty to pull together and craft the code you want without getting into the nitty-gritties or reinventing the wheel. As a mid-level language, C often requires that you craft your own functions, a task I undertake with eager glee.
Continue reading →

Posted in Lesson | Leave a reply

O Christmas Tree

Posted on December 24, 2022 by dgookin
Reply


It’s Christmas time, nerds rejoice! Welcome this festive season with a bit of programming acumen to festoon your old CRT monitor with some yuletide cheer.
Continue reading →

Posted in Lesson | Leave a reply

Tick Separators

Posted on December 17, 2022 by dgookin
Reply

No, a tick separator isn’t something you use on your dog during the summer. Instead, you find it in the upcoming C23 standard. A tick separator helps visually split up a long number, making it easier to read your code.
Continue reading →

Posted in Lesson | Leave a reply

Which C Version?

Posted on December 10, 2022 by dgookin
Reply

One thing I take for granted is which C standard I’m using. The differences between the versions are subtle, and the compiler chooses its standard by default. But this choice can be altered for compatibility or historical reasons.
Continue reading →

Posted in Lesson | Leave a reply

The Knight’s Tour

Posted on December 3, 2022 by dgookin
Reply

The task is truly complex: Navigating a knight around a chessboard, visiting each square but never the same square twice. It took me a while to code, and I don’t think my solution is particularly elegant, but it works.
Continue reading →

Posted in Lesson | Leave a reply

Post navigation

← Older posts

Recent Posts

  • Counting Terminal Rows and Columns
  • A Compact for Loop
  • Checking the CPU Clock
  • Not Every Compiler Likes Your Code
  • The volatile Keyword

Recent Comments

  • Chris Webb on How Big is That File? – Solution
  • dgookin on How Big is That File? – Solution
  • Chris Webb on How Big is That File? – Solution
  • Chris Webb on How Big is That File? – Solution
  • dgookin on Here a Thread, There a Thread

Meta

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

Copyright © 1997-2023 by QPBC.
All rights reserved