Re:Why does this C program compile?
by habosa on Wednesday December 19, 2012 @02:42PM
(#4944356)
Ok what in the world does that do?
[ Parent
| on HN ]
Re:Why does this C program compile?
by marssaxman on Wednesday December 19, 2012 @02:57PM
(#4944448)
It's just a fancy way of assembling the identifier "main" without writing it explicitly. Inside a preprocessor macro definition, the double hash mark is an operator which concatenates its left and right operands. This is a lexical operation. The "yell" macro takes six arguments and returns the concatenation of arguments 2, 3, 0, and 1, ignoring 4 and 5.
The billy_bob macro calls the yell macro, passing in some letters - if you look at which letters from "i,n,m,a,t,e" end up attached to which arguments in "yell", you'll see that "yell' rearranges 'i,n,m,a' to spell the word "main".