engrsanjiv
June 2nd, 2003, 04:10 PM
How the off set are set while allocating memory.
calss A()
{
public:
char a[10];
char b[2];
float c;
};
calss B()
{
public:
char a[10];
float c;
char b[2];
};
int aa=sizeof(A)// returns 16 bytes
int aa=sizeof(B)// returns 20 bytes
how the offsets are defined in structure and classes.
Thanks.
calss A()
{
public:
char a[10];
char b[2];
float c;
};
calss B()
{
public:
char a[10];
float c;
char b[2];
};
int aa=sizeof(A)// returns 16 bytes
int aa=sizeof(B)// returns 20 bytes
how the offsets are defined in structure and classes.
Thanks.