Originally published on: Wed, 22 Jul 2009 23:26:56 +0000
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
Save to del.icio.us
Save to StumbleUpon
Digg it
Save to Reddit
Share on Facebook
Share on Twitter
More bookmarks
Subscribe!
Auto Save Clipboard Images Redux
Extending SpiderMonkey JavaScript on Windows
Rhino JavaScript to EXE with launch4j
Compiling Rhino JavaScript to Java
Directory Traversal in Rhino JavaScript
A Command-Line MP3 Player for Windows
Auto Save Images from the Clipboard
Java in a Windows EXE with launch4j
An Interview with Tom Zimmer: Forth System Developer
Setting Windows Console Text Colors in C
Preserving my Favorite HN Links
An Interview with the Creator of the BDS C Compiler
A Simple Associative Array Library in C
Yet Another Enhanced Echo Command
Rhino JavaScript to EXE with launch4j
Command-Line Image Format Conversion
Book Review : Using Google App Engine
Auto Save Clipboard Images Redux
MicroISV on a Shoestring
DadHacker
The Bottom Feeder
Writin' That Code!
The Recursive ISV
The Thomsen Blog
Prototypically Speaking
The Reinvigorated Programmer