CodePudding user response:
One is the user explicitly call new instructions to call the constructor, the user can call his own, with new instructions, generating objects on the heap memory, (that is, the user you want to create an object is call new instructions to allocate memory)A compiler is implicit call to invoke a constructor with the new command, invoked by the compiler, or the new instruction, to generate the objects in the stack memory, (that is, the compiler inside the stack for local variables of a class when allocating memory hidden call with new instruction to create objects)
CodePudding user response:
Baidu to find, don't ask here,