I want something conceptually like this in c/c++
struct first{
int a,b,c;
}my1;
struct second{
int a,b,c;
int extended;
}my2;
and somehow be able to have
my2=my1;
(meaning only copy the same parts. leaving extended untouched)
I thought of solving it as
struct second{
first first_;
int extended;
}my2;
and have
my2.first_ = my1;
but it is a bit ugly for me. is there any more clear solution for this? probably it is something like extending a structure or something?