J
john sun
hello,
When we use new operator to user defined type, constructor will be called
and a memory block is created in heap. My question: where those non-pointer
data members belonging to this user-defined class will be create? on heap or
on stack? Obviousely it's on heap.
OK, if it's on heap, how stack unwinding meachnism can destroy those data
members when exception happened? Since it's not on stack, it's on heap!
I read the c++ progamming language by BStroustrup and can not find the
answer, please help understanding. Thanks very much!
John
When we use new operator to user defined type, constructor will be called
and a memory block is created in heap. My question: where those non-pointer
data members belonging to this user-defined class will be create? on heap or
on stack? Obviousely it's on heap.
OK, if it's on heap, how stack unwinding meachnism can destroy those data
members when exception happened? Since it's not on stack, it's on heap!
I read the c++ progamming language by BStroustrup and can not find the
answer, please help understanding. Thanks very much!
John