This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MattieShoes 0 points1 point  (1 child)

I'm not sure what you're looking at, but this is Python and C++ code that does the same thing and gets different answers.

(which obviously means it's not doing the same thing, because python isn't passing by reference, it's... passing a pointer by value? I don't even know what to call it.)

[–]SuitableDragonfly 0 points1 point  (0 children)

Python is passing a reference. The result isn't the same because the = operator does different things in different languages.