DEV Community

Clifford’s (aka, Claire’s) Device in C and C++ (opens in new tab)

Covers Duff's DeviceDiscussed on DEV

Introduction If you’ve been programming in C or C++ for a while, you likely have heard of Duff’s Device that takes advantage of C’s often-derided “feature” where case blocks “fall through” into the next case (if any). Regardless of what you think of that, I only recently discovered that there’s another “device” known as Clifford’s Device (alternatively known as Claire’s Device). While the problem it solves is completely different from Duff’s, it uses on another of C’s quirks. Preamble Sometim...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help