Can anyone clarify me about this: Apart from reserving the required memory, what else do the allocation operators do?
(a) Automatically deallocate the memory when it goes out of scope
(b) Automatically deallocate the memory when it is is no longer accessible
(c) Calls the constructor(s) for the specified type
(d) Calls the destructors(s) for the specified type
It seems to me after reading some info in wiki and other sites it is either A or C but I am not 100% sure - anyone?
Thanks.
VulpesPosted Jan 23, 2012, 1:00 PM
This is because you could describe 'delete' as a deallocation operator rather than an allocation operator as it's reclaiming the memory that was used by an object.
siabanie baniePosted Jan 23, 2012, 1:05 PM
siabanie baniePosted Jan 23, 2012, 12:56 PM
VulpesPosted Jan 23, 2012, 12:54 PM
These do (c) and (d) respectively.
They don't do (a) and (b).