K
karthikbalaguru
Hi,
I find that the structure padding is not being taken into account
while using 'new' operator.
Is there a way to enable it ?
struct Dataunit
{
char dataid[20];
int keyid;
float result;
} *p2;
p2 = new Dataunit; // This is allocating 26 bytes.
This allocates 26 bytes. Strange . .
Does C++ skip the Structure Padding concept while allocation of memory
using 'new' ?
Thx in advans,
Karthik Balaguru
I find that the structure padding is not being taken into account
while using 'new' operator.
Is there a way to enable it ?
struct Dataunit
{
char dataid[20];
int keyid;
float result;
} *p2;
p2 = new Dataunit; // This is allocating 26 bytes.
This allocates 26 bytes. Strange . .
Does C++ skip the Structure Padding concept while allocation of memory
using 'new' ?
Thx in advans,
Karthik Balaguru