K
Keith S.
This may be a dumb question, but I've searched the FAQ
and can't find an obvious answer...
Let's say I have a class e.g.
class fred
{
public:
int x;
int y;
};
then I create an array of fred:
freds = new fred[2];
Now, I'd expect to have allocated 8 bytes * 2 i.e. 16 bytes.
However, if I step through the code with a debugger I see
that operator new is getting called with a size of 20 bytes.
Why is this? What's the extra 4 bytes coming from?
The platform is VC++ .NET 2003 in debug mode if it makes any
difference...
- Keith
and can't find an obvious answer...
Let's say I have a class e.g.
class fred
{
public:
int x;
int y;
};
then I create an array of fred:
freds = new fred[2];
Now, I'd expect to have allocated 8 bytes * 2 i.e. 16 bytes.
However, if I step through the code with a debugger I see
that operator new is getting called with a size of 20 bytes.
Why is this? What's the extra 4 bytes coming from?
The platform is VC++ .NET 2003 in debug mode if it makes any
difference...
- Keith