J
John
Hi:
I have a question from the book---C++ primer, page 677.
char *arena = new char[ sizeof Image ];
Image *ptr = new (arena) Image( "Quasimodo" );
After the above two lines, arena and ptr point to the same memory.
If I "delete arena", that memory will be released, right?
Is ptr an dangling pointer now?
Thanks.
john
I have a question from the book---C++ primer, page 677.
char *arena = new char[ sizeof Image ];
Image *ptr = new (arena) Image( "Quasimodo" );
After the above two lines, arena and ptr point to the same memory.
If I "delete arena", that memory will be released, right?
Is ptr an dangling pointer now?
Thanks.
john