A macro with a ##
will concatenate the two elements together, for example if you use #define sptember oct ## ober
you will obtain october
.
So my problem is:
I have a macro like this #define getRegByPin(pin) set ## pin
than I have from 1 to 19 some defines like this: #define set0 xxx
and #define set1 xxx
, etc.
But when I call my macro in code
int p = getPinNo(pin); st(getRegByPin(p), p, to);
it replaces getRegByPin(p)
with setp
instead of set0
or set13
or etc.
What can i do?
Thx for help! You are awesome! :)