Skip to main content
Copy edited.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

When calling a constructor it actually allocateallocates memory, either from the stack or from the heap. So calling a constructor in another constructor creates a local copy. So we are modifying another object, not the one we are focusing on.

When calling a constructor it actually allocate memory either from stack or from heap. So calling a constructor in another constructor creates a local copy. So we are modifying another object not the one we are focusing on.

When calling a constructor it actually allocates memory, either from the stack or from the heap. So calling a constructor in another constructor creates a local copy. So we are modifying another object, not the one we are focusing on.

Source Link
XPD
  • 1.2k
  • 1
  • 15
  • 28

When calling a constructor it actually allocate memory either from stack or from heap. So calling a constructor in another constructor creates a local copy. So we are modifying another object not the one we are focusing on.