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 →

Your Own strdup() Function

Posted on January 2, 2016 by dgookin
Reply

In last week’s Lesson, I demonstrated the strdup() function. That function isn’t available in every C language library, but it’s easy to craft your own.
Continue reading →

Posted in Lesson | Leave a reply

To Copy or to Duplicate a String

Posted on December 26, 2015 by dgookin
Reply

The C library function to copy a string is strcpy(), which (I’m guessing) stands for string copy.
Continue reading →

Posted in Lesson | Leave a reply

99 Bottles of Beer

Posted on December 19, 2015 by dgookin
Reply

This month’s Exercise involves coding the lyrics for a cumulative song. Perhaps the most famous, and certainly the most obnoxious, cumulative song is the old warhorse, 99 Bottles of Beer.
Continue reading →

Posted in Lesson | Leave a reply

Check That Sum

Posted on December 12, 2015 by dgookin
Reply

The old computer processing adage is “garbage in, garbage out.” What it means is that unless your data is good, don’t expect to see good results. So what can be done to ensure that the data is good? A checksum, that’s what.
Continue reading →

Posted in Lesson | Leave a reply

Encoding and Decoding, Part VII

Posted on December 5, 2015 by dgookin
Reply

The final part of the decoding program performs the actual decoding: A two-byte hexadecimal string is converted into a value. That value is then manipulated by the XOR 0xAA operation. The result is output. Yep, it took a long time to get to this point.
Continue reading →

Posted in Lesson | Leave a reply

Encoding and Decoding, Part VI

Posted on November 28, 2015 by dgookin
Reply

Data encoded by my hexencode system is formatted. That means that the decoding program must look for both the header and footer in that formatted output. In last week’s Lesson, code was added to confirm the input file’s first line as the header. This week’s modification is to search for the end of encoded text.
Continue reading →

Posted in Lesson | Leave a reply

Encoding and Decoding, Part V

Posted on November 21, 2015 by dgookin
Reply

You don’t want your decoding program to waste time attempting to process input that isn’t in the proper format. That’s why the encoding program bothers to put a specific header as the first line of text. Therefore, one of the first tasks for the decoding program is to check for that specific header.
Continue reading →

Posted in Lesson | Leave a reply

Encoding and Decoding, Part IV

Posted on November 14, 2015 by dgookin
Reply

It would be a grand thing to set out and craft the entire decoding program in one sitting. That’s ambition in action, but it doesn’t demonstrate much programming experience.
Continue reading →

Posted in Lesson | Leave a reply

Encoding and Decoding, Part III

Posted on November 7, 2015 by dgookin
Reply

You can output values in the hexadecimal format, thanks to the %x and %X placeholders in the printf() function. Getting hex strings as input is also possible, but not entirely obvious.
Continue reading →

Posted in Lesson | Leave a reply

Encoding and Decoding, Part II

Posted on October 31, 2015 by dgookin
Reply

To help improve the presentation of encoded data, consider sprucing up the output.
Continue reading →

Posted in Lesson | Leave a reply

Post navigation

← Older posts
Newer posts →

Recent Posts

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

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