Ad
  • Custom User Avatar

    i like this one. It's clever solution.

  • Custom User Avatar

    A reference/pointer is often 8 bytes long on the x64 architecture, so it's always pointless for primitive types unless you want to actually change them

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Passing a basic type (such as int, char, bool, float etc) by reference can actually be less efficient than passing it by value. Remember that a reference is just a pointer and it's address still needs to be copied to the function (and since the address is an int, it's exactly as costly as passing by value). And then there's also the overhead of dereferencing that pointer (basically the * operator, which the language is hiding from us when we use references, but it's still there). So all in all, it's not worth it!