Re:The Descent to C (2013)
by lifthrasiir on Friday September 03, 2021 @12:33PM
(#28406369)
One of the very first IOCCC winners used the trick in 1984 (1984/anonymous):
[ Parent
| on HN ]
I think this is equivalent to:
int i;
int main(){
for(
;
i["]<i;++i){--i;}"]; // loop until i == 14? (the NUL byte on the end)
read('-'-'-',i+++"hello, world!\n",'/'/'/') // read(0, <one byte of "hello, world!\n" at a time>, 1)
) {};
}
int read(j,i,p){
write(j/p+p,i---j,i/i); // write(0/1+1, i-- - 0, 1) --> write(1, i, 1) --> write a byte to STDOUT
}what does this program do? i compiled it and ran it and got no output. i hope i haven't fork bombed myself or something
Re:The Descent to C (2013)
by lifthrasiir on Friday September 03, 2021 @01:05PM
(#28406746)
Prints "hello, world!", assuming sizeof(int) == sizeof(char*) (and the same alignments and ABI, etc).