[OT] C++ question re. dyn. mem.
Will the free store be properly maintained when the following is executed?
// a simple object is defined
// allocate some memory for an instance of this object
t_my_type * p_a = (t_my_type) new t_my_type;
// change the way it is accessed to prove a point
int * p_b = (int *) p_a;
// p_a and p_b point to the same block of dyn. allocated memory;
// return the memory to free storage using the second pointer
I think the free store will be maintained properly because there is a control
block attached to the allocated block of storage that defines the length of
the allocated memory.