Hi
I am not sure if its the right forum to post this question. Sorry for that.
CCS version : 6.1.0.00104
Compiler : v6.4.3
I have two structs as shown below...
typedef struct _ABC_
{
float a;
float b;
float c;
}ABC;
typedef struct _XYZ_1_
{
int a0;
ABC abc1;
}XYZ1;
typedef struct _XYZ_2
{
int a1;
ABC abc2;
}XYZ2;
I want to copy the struct ABC in the struct XYZ2 to the struct ABC defined as a member in struct XYZ1.
i know the most basic way as
void sampleFn(void){
XYZ2 xyz2;
XYZ1 xyz1;
/* This works fine */
xyz1.abc1.a = xyz2.abc2.a;
xyz1.abc1.b = xyz2.abc2.c;
xyz1.abc1.c = xyz2.abc2.c;
/* But this doesnt work */
xyz1.abc1 = xyz2.abc2;
}
Any help on this would be greatly appreciated.