T
timor.super
in C, I have this :
#define doStuff(var) func(var##_1, var##_2)
void func(int v, int v2)
{
printf("%d, %d\n", v, v2);
}
int main()
{
int myvar_1 = 1;
int myvar_2 = 2;
doStuff(myvar);
// ...
}
I want to do a class to encapsulate the func, but how can I do the
same thing with a class ? I would like to do something like this :
int myvar_1 = 1;
int myvar_2 = 2;
CMyClass c;
c.doStuff(myvar);
How can I do that ?
Thanks for your help,
S.
#define doStuff(var) func(var##_1, var##_2)
void func(int v, int v2)
{
printf("%d, %d\n", v, v2);
}
int main()
{
int myvar_1 = 1;
int myvar_2 = 2;
doStuff(myvar);
// ...
}
I want to do a class to encapsulate the func, but how can I do the
same thing with a class ? I would like to do something like this :
int myvar_1 = 1;
int myvar_2 = 2;
CMyClass c;
c.doStuff(myvar);
How can I do that ?
Thanks for your help,
S.