Originally published on: Wed, 22 Jul 2009 23:26:56 +0000
Please note! If you're having difficulties compiling the C source code presented below, please see my post: Compiling C from the Command Line with Pelles C
Here's a simple C routine written as a preprocessor macro that will perform ROT13 encoding on a single character.
If your C compiler's version of tolower expands to a nested ternary expression, then the above macro may generate some tricky-to-read code out of the preprocessor phase.
Here's a simple program to read a string from stdin and ROT13 encode it using the above macro.
Unless otherwise noted, all code and text entries are Copyright ©2009 by James K. Lawless
Views expressed in this blog are those of the author and do not necessary reflect those of the author's employer. Views expressed in the comments are those of the responding individual.

Save to StumbleUpon
Digg it
Save to Reddit
Share on Facebook
Share on Twitter
More bookmarks
Click **here**
A JavaScript REPL for Android Devices
A Review of Kevin Mitnick's Book Ghost in the Wires
Play MP3 Files with Python on Windows
Screen Captures with Java and Clojure
Tracing XSLT with a Tiny Java Web Server
Auto Save Images from the Clipboard
An SMTP Server Simulator in Perl
Safe Scripting with Scroll Lock and Caps Lock
Embedding JavaScript in a Batch File
Why Some Web Sites will go Dark on Jan 18th
Book Review : Paull Allen - Idea Man
A 90's Experiment in Online Systems - The U.S. West CommunityLink Service