N
nick4ng
I need to do something like this
#define P1(x) int x##__LINE__ = __LINE__;
int main(int argc, char* argv[])
{
P1(a);
P1(a);
}
I mean that the macro should be expanded in this way:
int main(int argc, char* argv[])
{
int a3 = 3;
int a4 = 4;
}
but the code above does not work.
How would you implement it?
Thanks
#define P1(x) int x##__LINE__ = __LINE__;
int main(int argc, char* argv[])
{
P1(a);
P1(a);
}
I mean that the macro should be expanded in this way:
int main(int argc, char* argv[])
{
int a3 = 3;
int a4 = 4;
}
but the code above does not work.
How would you implement it?
Thanks