I have a struct and need to create multiple instances before starting. When loading data I am finding that variables are being copied between instances. I think I must had done something silly.
=== im trying to have a golbal system struct...
master.sys.dclink1.voltage = 240;
master.sys.dclink2.voltage = 400;
=== after the folloing lines I end up with
master.sys.dclink1.voltage is 400;
master.sys.dclink2.voltage is 400;
struct DCLINK{
float voltage;
float current;
};
union SYS{
struct DCLINK dclink1;
struct DCLINK dclink2;
} ;
struct MASTER{
union SYS sys;
};
struct MASTER master;