C
Cristian.D.Guajardo
Hi.. I'm trying to create a macro that accepts 3 variables, one of
which changes when I call it. The problem I'm running in to is that the
third argument is sent as a variable, so it receives it as a letter and
not the corresponding value. here's some code to clarify:
#define some_macro(first, second) dothis(first, something##second)
....
and in my main function I have:
int x = 100;
for(i =0; i < 5; i++)
arr = some_macro(x, i);
Now, the problem is that when the macro resolves, it plugs in the
letter i instead of 0,1,2,3.. etc.
Anyone know a way around this?
which changes when I call it. The problem I'm running in to is that the
third argument is sent as a variable, so it receives it as a letter and
not the corresponding value. here's some code to clarify:
#define some_macro(first, second) dothis(first, something##second)
....
and in my main function I have:
int x = 100;
for(i =0; i < 5; i++)
arr = some_macro(x, i);
Now, the problem is that when the macro resolves, it plugs in the
letter i instead of 0,1,2,3.. etc.
Anyone know a way around this?