Top "Pass-by-value" questions

pass-by-value is a "one way passing" so that modifications of the passed value inside the receiving function (or other entity like process, etc) are not returned back.

Modify elements of vector (by value, by reference) Function C++

I have a function where I have to modifiy the values of a vector. is it a good practice in …

c++ function vector pass-by-reference pass-by-value
Are golang slices passed by value?

In Golang, I am trying to make a scramble slice function for my traveling salesman problem. While doing this I …

go slice pass-by-value
Pass by Value in C#

How can I pass an object of a "MyClass" (C#) by Parameter-by-Value to a method? example: MyClass obj = new MyClass(); …

c# pass-by-value
Java Pass By Value and Pass By Reference

i have done the following sample with to check my knowledge import java.util.Map; public class HashMap { public static …

java hashmap pass-by-reference pass-by-value
Java pass by reference

What is the difference between this 2 codes: Code A: Foo myFoo; myFoo = createfoo(); where public Foo createFoo() { Foo foo = new …

java parameter-passing terminology pass-by-reference pass-by-value
java Boolean value not changing in called method

I have a scenario where I want to set a Boolean object and then use its booleanValue() in a constructor …

java pass-by-reference pass-by-value
Array and slice data types

I found myself confused with the array and slice data types. From Go docs, arrays are described as follows: There …

arrays go slice pass-by-value func
How are arrays passed?

Are arrays passed by default by ref or value? Thanks.

c++ arrays pointers pass-by-reference pass-by-value
Is Java really passing objects by value?

Possible Duplicate: Is Java pass by reference? public class myClass{ public static void main(String[] args){ myObject obj = new myObject("…

java parameter-passing terminology pass-by-reference pass-by-value
Are structs 'pass-by-value'?

I've recently tried to create a property for a Vector2 field, just to realize that it doesn't work as intended. …

c# struct pass-by-value