I create a point and then copy its coordinates.
I then change the x value of the coordinate I just copied.
When I display both the coordinate of the original point and the new point
both of then now have the new value. I don’t understand why the original coordinate’s value
has changed. It was not modified. I’ve never seen this in a programming language.
wow
I thought I was creating another coordinate with same values similar to standard programming which is
how I learned to copy data.
I miss read the debugger too. It showed two distinct label.
Copying values only works with basic data types such as float, int, bool.
Classes such as point when applying equals are shallow copies.
Extra reading: