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 →

Functions as Structure Members

Posted on November 23, 2019 by dgookin
5

A programming puzzle kept me awake one night: If a structure allows for any variable type to be a member, and a function is a valid variable type, why not have a structure with a function as one of its members? Am I nuts?
Continue reading →

Posted in Lesson | 5 Replies

Deviously Playing with Memory

Posted on November 16, 2019 by dgookin
2

When a buffer is void, its contents are treated as raw memory, not assigned to any specific data type. This ambiguity means your code can cast the memory’s data type and do interesting things with it.
Continue reading →

Posted in Lesson | 2 Replies

Playing with Memory

Posted on November 9, 2019 by dgookin
Reply

Gone are the old days when your C program ruled the entire computer’s domain. Back then, you could access any chunk of memory in the computer, manipulate it in all sorts of interesting ways, and not be concerned that your code’s actions would be restricted. Ah, those were good times.
Continue reading →

Posted in Lesson | Leave a reply

The Yorn Function – Solution

Posted on November 8, 2019 by dgookin
Reply

The most difficult thing about this month’s Exercise is to deal with stream input: When the user overstuffs the input buffer, those extra characters continue to flow into the program, interpreted as additional input and they make the output look ugly.
Continue reading →

Posted in Solution | Leave a reply

The Poker Program

Posted on November 2, 2019 by dgookin
2

With all the hand-ranking functions complete (see last week’s Lesson), the final version of my poker program restores the randomizer, draws and sorts a hand, then outputs the hand’s value. It’s quite disappointing.
Continue reading →

Posted in Lesson | 2 Replies

The Yorn Function

Posted on November 1, 2019 by dgookin
2

When a computer program wants to know a Yes or No answer, the function I write is called yorn().
Continue reading →

Posted in Exercise | 2 Replies

One or Two Pairs (Poker VIII)

Posted on October 26, 2019 by dgookin
Reply

Matching two card values in a poker hand counts as a pair. It’s the lowest-ranking hand (above the non-ranked “high card”) and the most common. In my poker program, it’s also the last ranking hand tested.
Continue reading →

Posted in Lesson | Leave a reply

Four-of-a-Kind, Three-of-a-kind, and a Full House (Poker VII)

Posted on October 19, 2019 by dgookin
Reply

To effectively evaluate poker hands, the next sequence after a straight, straight flush, and flush draw (covered in last week’s Lesson) is to evaluate four-of-a-kind, then three-of-a-kind, and (while you’re at it) a full house.
Continue reading →

Posted in Lesson | Leave a reply

Flush, Straight, and Straight Flush Tests (Poker VI)

Posted on October 12, 2019 by dgookin
Reply

After pulling out any hands arranged in a straight pattern, covered in last week’s Lesson, the next logical test is for a flush. The flush draw is when all cards are of the same suit.
Continue reading →

Posted in Lesson | Leave a reply

Know Your GPA – Solution

Posted on October 8, 2019 by dgookin
2

It’s fun supplying your own scores for a semester, which really helps boost your GPA! Still, the challenge for this Month’s Exercise was to input — and validate — a series of grades to calculate your GPA for five courses.
Continue reading →

Posted in Solution | 2 Replies

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Code Page 437
  • Dumping the Screen in W-I-D-E Color
  • Which is Greatest? – Solution
  • Dumping the Screen in Color
  • Which is Greatest?

Recent Comments

  • dgookin on Code Page 437
  • M.Stumpfl on Code Page 437
  • dgookin on Dumping the Screen in W-I-D-E Color
  • M.Stumpfl on Dumping the Screen in Color
  • Chris Webb on Dumping the Screen in W-I-D-E Color

Meta

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

Copyright © 1997-2025 by QPBC.
All rights reserved

Proudly powered by WordPress