Skip to content

Archive

Tag: c-language-programming

Some time ago, I wrote about well-known trick for a two-value exchange using no intermediate variables. It’s a fun party-trick, but unless you’re working with an unusually constrained embedded project, it’s unlikely that you would ever really need to use it. On the other hand, hidden within that little trick is some real memory-conserving magic.

Continue reading “Exchanges Applied” »

I’ve been writing software in C since 1991. While that was shortly after the ratification of the C89/90 standard, it took at least a few years for most compilers to catch up. So my formative years in C were spent developing code for compilers that weren’t yet standards conformant. Certain features were hit and miss. Since much of my development work involves C, I try to keep up with new developments. I freely admit that I don’t know it all; and every few years someone teaches me a new trick or hack that makes life just a little bit easier. Recently, I found a major gap in my understanding of one important aspect of the language.

Continue reading “Structs in Wonderland” »

An article was brought to my attention recently. It contains an interview with Bjarne Stroustrop, of C++ fame, discussing the language to which he gave life. Aside from a few technical non sequiturs, such as referring to C++ as “the archetypal ‘high level’ computer language (that is, one that preserves the features of natural, human language)”, I found the article rather entertaining.

Continue reading “Languages for High-Integrity Software” »

I don’t know who originated this trick.  I first read about in in P.J. Plauger’s “Programming on Purpose”.  It was probably first used by assembly language programmer’s when 4-bit systems were common and memory was paltry.  Still, it can be handy in a tight loop even on a relative fast processor.

Continue reading “Fast Exchange” »

Blog WebMastered by All in One Webmaster.
Google Analytics Alternative