New will always "initialise" memory. However, the result of that
"initialisation" depends on the form of 'new' and the type you
allocate. For example, if you omit the initialiser altogether,
objects will be "default-initialised" which for non-POD means
invoking their default constructor and for POD types means leaving
them uninitialised, etc.
I think this is where I have been having difficulty. If, for example
I have a structure/class something like this:
class XYZPrivate
{
public:
unsigned char ucArray[1024];
unsigned int uiValue;
};
And then somewhere I do this:
XYZPrivate* p_ = new XYZPrivate();
will this initialise both the array and the value to zero, or just the
value? I could of course put an explicit constructor in the class to
memset stuff to zero, but that just seems inelegant.