K
kk_oop
Consider class X and Y where:
class X
{
double d;
int i;
Y myY;
};
class Y
{
int h;
int g;
};
If I pass the address of an instance of X (cast to a char *) to a
binary ofstream's write() method, indicating sizeof(X) as the size of
the data, would that write out all of X, including the state of its Y
instance?
Thanks!
Ken
class X
{
double d;
int i;
Y myY;
};
class Y
{
int h;
int g;
};
If I pass the address of an instance of X (cast to a char *) to a
binary ofstream's write() method, indicating sizeof(X) as the size of
the data, would that write out all of X, including the state of its Y
instance?
Thanks!
Ken