Many questions talks about POD; But all questions talks about full object copy. Can I apply the same concept on the plain old data part of a class. Example:
struct Parent1
{
int x;
float y;
};
struct Parent2
{
int k;
float l;
};
struct NotPod : public Parent1, public Parent2
{
char z;
short w;
};
NotPod a, b;
void func()
{
a.z = '4';
a.w = 345;
memcpy((char*)&b.z, (char*)&a.z, (char*)(&a.w)-(&a.z) + sizeof(a.w));
}
I am asking about old c++ (not C++11).