The C preprocessor does just dummy text substitution at compile time.
What means text substitution? The preprocessor will output C code substituting the parameters of the macro with the passed values. It does not matter if you pass a variable or a constant number, you will just get dummy substitution (also called macro "expansion").
Let's go to see how the preprocessor will "expand" #define cat(a,b,c) a##b##c
.
d=cat(1,2,3);
expands to: d=123;
and this is valid code because you have declared int d
.
d=cat(a,b,c);
expands to: d=abc;
and this will not compile since there's no int abc
variable.
What means compile time? It means that this text substitution is done on the source code, and the output disregards the content of the variables passed to the macro. In other words, it does not matters that you have initialized a
, b
, and c
to 1
, 2
, and 3
: the result will be just the concatenation (due to the ##
"token-pasting" preprocessor operator) of the passed values. In your case the result is abc
, which means nothing in your code.