The compiler doesn't see "begin" whatsoever. It's completely substituted by the time it gets to the compiler, because macros are simply text-substitutions. Perhaps a helpful diagram to add on to the other great answers.
#define decode(s,t,u,m,p,e,d) m##s##u##t
#define begin decode(a,n,i,m,a,t,e)
Take a look at m
, and see where m
is in the argument list.
decode(s,t,u,m,p,e,d)
^
|
decode(a,n,i,m,a,t,e)
Therefore the first letter is m => m
. Then repeat the process, s => a
, u => i
, t => n
.
decode(s,t,u,m,p,e,d)
^ ^ ^
| | |
decode(a,n,i,m,a,t,e)
Then the resulting letters are "pasted" together with token concatenation, and it looks like main
as far as the compiler is concerned.