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 →

The Playing Card Structure (Poker II)

Posted on September 14, 2019 by dgookin
Reply

Drawing cards from a deck is an activity requiring more effort than flagging an element in an array, which was demonstrated in last week’s Lesson. Such code works, but it’s best to set details about the card when it’s drawn, noting its face value and suit, for example. Such complex information is best placed into a structure.
Continue reading →

Posted in Lesson | Leave a reply

Next Tuesday – Solution

Posted on September 8, 2019 by dgookin
2

One way to discover next Tuesday’s date is just to wait. You could code that solution in C, which would be silly, but I hope that you instead chose to use some time functions to derive your answer.
Continue reading →

Posted in Solution | 2 Replies

Draw Five Cards (Poker I)

Posted on September 7, 2019 by dgookin
Reply

To code a card game, you must start with the deck: 52 cards divided into 4 suits each consisting of 10 number cards and three face cards. Seems easy.
Continue reading →

Posted in Lesson | Leave a reply

Next Tuesday

Posted on September 1, 2019 by dgookin
Reply

What’s today?

The reply could be the day of a week, such as Sunday. That’s how I first answer the question. The more detailed answer is the day of the month, which isn’t often on my mind — unless it’s an important day like a birthday or some event.
Continue reading →

Posted in Exercise | Leave a reply

Structures and Arrays, Part III

Posted on August 31, 2019 by dgookin
Reply

I’ve wrapped up most of the oddities about structure/pointer/array notation in the past two Lessons (Part I and Part II). All that’s left is for me to go insane and start allocating structures as pointers with all their members as pointers.
Continue reading →

Posted in Lesson | Leave a reply

Structures and Arrays, Part II

Posted on August 24, 2019 by dgookin
Reply

When it comes to structures and pointers, the structure-pointer notation is used only when the structure itself is allocated as a pointer (block of memory), not when a structure member is a pointer. Let me review from last week’s Lesson:
Continue reading →

Posted in Lesson | Leave a reply

Structures and Arrays, Part I

Posted on August 17, 2019 by dgookin
Reply

Structures in C have their own issues when it comes to structure-pointers and structures within pointers. I wrote about this issue a few months back.

Another structure issue occurs with arrays within structures and arrays of structures. It also involves interesting notation — especially when you add pointers to the mix.
Continue reading →

Posted in Lesson | Leave a reply

Extremely Buffered Output

Posted on August 10, 2019 by dgookin
Reply

A few weeks back, I wrote a post on the fflush() function, which immediately relieves an output buffer, releasing its contents. The mirror opposite of this function might be another output control function, setbuf().
Continue reading →

Posted in Lesson | Leave a reply

Rotate the Grid – Solution

Posted on August 8, 2019 by dgookin
Reply

The challenge for this month’s Exercise is to fill a grid with random letters, a to z, then rotate that grid on its side, counterclockwise, and display the results. Such fun.
Continue reading →

Posted in Solution | Leave a reply

The Teeniest of Tiniest

Posted on August 3, 2019 by dgookin
2

It took me a while to figure out the significance of the nextafter() function. Though I understand what it does now, I still can’t figure out how it’s useful, though I assume it has a valid purpose otherwise it wouldn’t be in the standard library.
Continue reading →

Posted in Lesson | 2 Replies

Post navigation

← Older posts
Newer posts →

Recent Posts

  • The Ever-Expanding Pointer Array
  • Heron’s Formula – Solution
  • Coding a Better stringcopy() Function
  • Heron’s Formula
  • Copying Strings

Recent Comments

  • dgookin on Heron’s Formula
  • Chris Webb on Heron’s Formula
  • dgookin on Heron’s Formula
  • Chris Webb on Heron’s Formula
  • dgookin on Finding Those Pesky Null Characters!

Meta

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

Copyright © 1997-2025 by QPBC.
All rights reserved

Proudly powered by WordPress