News for hackers. Stuff that matters.
Re:C++ Papercuts by fluoridation on Monday August 28, 2023 @10:24AM (#37294505)
No, strings are passed by reference, it's just that the string type is immutable. Passing a string to a function doesn't create a copy, but there's also no way for the callee to modify the object that the caller points to.

It is true that C# has value types that are by default passed by copy, though.

Re:C++ Papercuts by raincole on Monday August 28, 2023 @11:22AM (#37295575)
I mistyped struct as strict.