Home > Back-end >  Such storage location problem
Such storage location problem

Time:10-15

An instantiation is stored in the stack class, the constructor of the new space is on the stack or in the heap?

CodePudding user response:

Are new came out in a heap, as local pointer variable pointing to heap memory within the stack, the pointer variable itself in the stack, but is the new out of memory in the heap

CodePudding user response:

CodePudding user response:

This will divide the situation actually, if you are new to the object without overloading the new operator, it must be on the heap, if you are new to the object of overloading the new, will have to see the specific code, it is possible that in the stack space,
  • Related