ngl c++ is a fun language, it feels like I’m finally getting access to all the really fun programming stuff, like, am I/code.org just dumb or is explicitly passing a variable into a function by reference not a thing in java (and definitely not in js/lua)
also the fact that you can’t make read-only variables read-only in python is dumb
please let me know if I am just uneducated in the languages I’m dissing(?)
in java functions are given a copy of the reference to an object*, while in c++ they are actually given a reference.
in short, this means
argument = new Whatever();will modify the caller’s instance in c++, but not in javai think javascript works the same way
*except for primitives, which are always passed by value
ok yeah, that’s what I thought, in c++ it can be either, putting DATATYPE& parameter in the function header makes it pass by reference, otherwise it passes by copy