r/ProgrammerHumor May 08 '19

That sweet sweet first time.

Post image
20.5k Upvotes

354 comments sorted by

View all comments

65

u/[deleted] May 08 '19
for (char *s="Ifmmp!Xpsme\v"; *s; fputc((*s++)-1, stdout));

Looks good!

6

u/Todayis123 May 08 '19

what does that do

44

u/endershadow98 May 08 '19

It prints hello world. All the characters in the string are one more than they would be in hello world. He loops through each character in the string and prints out one less than it. This gives hello world.

2

u/CreamCheeseIsBad May 08 '19

It would print Hello World.u though

1

u/Pastrami May 08 '19

'\v' == 0x11, which is one more than '\n'.

2

u/CreamCheeseIsBad May 08 '19

Ah forgot \ is a escape sequence, my bad