Actually, they are guaranteed to exist. According to ISO C99 TC3 (PDF) section 6.4.5 #5, string literals (e.g. "foo", the ones in inflect()) initialize arrays with static storage duration. According to 6.2.4 #3, objects with static storage duration have a lifetime which is "the entire execution of the program".
The strings in inflect() are not only guaranteed to exist after the function's block is left, they are guaranteed to exist before the first time the function executes (5.1.2 #1).
In other words, that code is safe. :)
Updated: to sound a little less hostile
email: perl -e 'print reverse map { chr( ord($_)-1 ) } split //, "\x0bufo/hojsfufqAofc";'
|