4 ms·
> Nowadays, everything is pass-by-value. Except for obscure, seldom-used languages like C++ and C#. If you can write int a; ParseInt("123", a); P
by paulddraper 9y ago
> Nowadays, everything is pass-by-value.
Except for obscure, seldom-used languages like C++ and C#.
If you can write
int a;
ParseInt("123", a);
Print(a); // print 123
your language has pass by reference.
- pjmlp 9y agoI would add other unknown languages like Ada, D, VB.NET, Delphi, FreePascal, Rust.
- tomjakubowski 9y agoRust's references are ordinary values. Moreover, the GP's example wouldn't work in Rust; you'd need to pass a value of type &mut i32 to ParseInt to mutate the value.