Re: How to understand this line of c ?




"lnzju" <geniuslee@xxxxxxxxx> wrote in message
news:1136051664.299850.274430@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> main(_){for(--_;putchar(_++["J!Mpwf!Zpv\1"]-1););}

Here it is a little clearer [hopefully?]

#include <stdio.h>

// x will be 1 (the name of this app would be in argv[0]) if we
// don't invoke the app with some args.
//
main(x)
{
char c;

// zero then!
//
--x;

while(c = "J!Mpwf!Zpv\1"[x])
{
// No need for the -1 if we add 1 to the literal's characters...
//
// "I Love You\1"
//
c = c - 1;

x++;

putchar(c);
}
}


.



Relevant Pages

  • Replacing character/(s) in a line
    ... Can somebody show me how to replace a char with another char in ... everyline of a file. ... file contains a zero, if so I want to repalce it with a 1. ... Prev by Date: ...
    (comp.lang.awk)
  • Re: What to use in place of NULL for a char ?
    ... a = (char) false; ... value is zero, say so: ... Prev by Date: ...
    (comp.sys.mac.programmer.help)
  • Re: Help-a-Dummy Please
    ... stack around Switches is corrupt". ... As the memory for the array char * Args[] is allocated outside the object as ...
    (microsoft.public.vc.language)
  • Re: Code readability vs. execution time
    ... introduced standard. ... When I want to cast a string to an integer, ... I am still not sure WHAT that last statement means, 0 means unsassigned, non zero, or what... ... char foo ...
    (comp.lang.php)
  • Re: how the following two code parts same
    ... mainreturns int by definition. ... char i = NULL; ... to zero. ... printf; ...
    (comp.lang.c)