The C Programming Language, by Brian W Kernighan & Dennis M Ritchie & HP Lovecraft

Exercise 4-13. Write a function reverse(s) which reverses the string s by turning the mind inside out, converting madness into reality and opening the door to allow the Old Ones to creep forth once more from their sunken crypt beyond time.
Tags: , , ,

7 Responses:

  1. jhf says:

    I believe you can find that function in the source for GPM.

  2. maramala says:

    Also applicable with PHP programming in multiple platforms.

  3. pikuorguk says:

    It involves strtok() and self-modifying char * pointers, right?

  4. lloydwood says:

    ...a correct citation is "The C Programming Mythos, by Brian W. Kernighan, Howard P. Lovecraft and Dennis M. Ritchie," New England Press, third edition, 1998.

    Some true horror lies in the foreword newly prepended to this edition, where there is much discussion of paganism, sexual rites, curses, and "our tribe." This later contribution by Eric S. Raymond, who had some notoriety at the time, is generally thought to diminish the original text. The foreword can be passed by - although Chapter 1 must be read carefully in its entirety to prepare the mind to resist the rigours of all that follows.

  5. Earlier we said that a function is (or ought to be) a ``black box'' which does some job and does it well. ... You're not supposed to have to worry about any reasons why ...

  6. maxcelcat says:

    That's not in my copy of K & R! I've been gypped!

  7. Debugging is going to be a drag.