Hi all ,
Suppose i have structurs defines as follows :
struct S1
{
int n1 ;
int n2 ;
int n3 ;
};
struct S2
{
int i1 ;
int i2 ;
int i3 ;
};
i need to copy each member from S1 to it's corresponding in S2 something like:
s1.n1 = s2.i1 ;
s1.n2 = s2.i2 ;
s1.n3 = s2.i3 ;
is there a way to create those line in a macro ???
what i need is something like :
#define COPY(n)
#if ( n != 0 )
copy n to i\
COPY(n-1) \ reccursive call
#endif
BTW : i'm using vc++ compiler (and preprocessor).
Thanks.
Suppose i have structurs defines as follows :
struct S1
{
int n1 ;
int n2 ;
int n3 ;
};
struct S2
{
int i1 ;
int i2 ;
int i3 ;
};
i need to copy each member from S1 to it's corresponding in S2 something like:
s1.n1 = s2.i1 ;
s1.n2 = s2.i2 ;
s1.n3 = s2.i3 ;
is there a way to create those line in a macro ???
what i need is something like :
#define COPY(n)
#if ( n != 0 )
copy n to i\
COPY(n-1) \ reccursive call
#endif
BTW : i'm using vc++ compiler (and preprocessor).
Thanks.
Comment