T
Tom Groszko
I need some help with the ## macro statement.
I am writing a macro that will be used multiple times. It will define
variables that will each have to have a different name.
When I try to compile this sample code I get the message that xxxx is
defined more than once. Reading about ## seems like this will solve the
problem but it is not clear to me how to use it.
Can anybody help?
A solution other than using macros is also welcome.
Thanks
Tom G.
class SampleClass
{ public:
SampleClass (const char * abc);
};
#define SampleMacro(somevalue) SampleClass xxxx(somevalue);
void someroutine (void)
{
SampleMacro("somevalue1")
SampleMacro("somevalue2")
}
I am writing a macro that will be used multiple times. It will define
variables that will each have to have a different name.
When I try to compile this sample code I get the message that xxxx is
defined more than once. Reading about ## seems like this will solve the
problem but it is not clear to me how to use it.
Can anybody help?
A solution other than using macros is also welcome.
Thanks
Tom G.
class SampleClass
{ public:
SampleClass (const char * abc);
};
#define SampleMacro(somevalue) SampleClass xxxx(somevalue);
void someroutine (void)
{
SampleMacro("somevalue1")
SampleMacro("somevalue2")
}