The Case for the Default Case

In a previous post, Andrei discussed the switch statement. In this post, he gives a more indepth review of switch and then deeply dives into the default case.

Rather than just leaving it out, default can be used to detect the impossible. Read on to handle whoopses, neutrino hits, and beer. And remember, be assertive, but be kind to your future self.

Read More

Scope II

C uses the static keyword for two completely separate purposes simultaneously. In this week's post, Andrei will continue his discussion of variable visibility (scope), look at function scope, and how to limit scope to a single file, using the static keyword.

It's not as shocking as you might imagine, unless you let go.

Read More

Embedded Wednesdays: Logic in C Part I

Andrei drew the short straw. His punishment was to write a blog post on boolean logic and bit manipulations. That way Elecia and Chris Svec could refer to the post rather than having to explain it themselves.

This first part is a useful review of boolean logic. If you find it useful, please buy Chris Gammell a beer. 

Read More

Embedded Wednesdays: Functions Part 2

In the final serving of the Embedded Wednesdays crash course in C, Andrei gives a bowlful of function goodness. Parameters, return values, headers, and prototypes. Sprinkle some prototypes, add #includes on top, then add some Good Habits for keeping you regular. But you can't have all of this wholesome goodness without talking about the inevitable void.

In French, the Rice Krispie guys Snap, Crackle, and Pop are known as Crik, Crak, and Crok. All of those names start with C. Coincidence, I don't think so. Pull up a chair and grab a heaping helping of C functions.  (Corny? No, I Oat to know how that is Spelt)

Read More

Embedded Wednesdays: A Crash Course in C - Part 1 - Integers

After a review of the Embedded Wednesdays classes at ENTS, we identified a need for more information about the C language.

This week Andrei starts a series of posts introducing the C language. In this first post he describes the integer data type and some best practices.

 

Read More