Top "Pass-by-reference" questions

Pass by reference is an argument marshalling strategy whereby a variable's location in memory is passed to a function, rather than a copy of the variable's value, although the function appears in the source code to receive the variable itself rather than a pointer to it.

Cython & C++: passing by reference

I am a noob with Cython and C++, so I have a question on argument passing. I want to avoid …

python c++ reference pass-by-reference cython
C++ view types: pass by const& or by value?

This came up in a code review discussion recently, but without a satisfactory conclusion. The types in question are analogues …

c++ c++11 parameter-passing pass-by-reference pass-by-value
How to pass pointer to function and dynamically allocate memory within function C++

I'm trying to declare a pointer and pass that pointer to a function where memory is allocated. Here is a …

c++ pointers pass-by-reference pass-by-value function-definition
By Ref parameters in VB.NET and C#

I have question related passing parameters byRef, I have VB.NET based class library in which some functions are defined …

c# vb.net pass-by-reference byref
How to modify an array in function?

MATLAB is a pass by value language. I have a recursive function that processes pixel's neighbors. It is very expensive …

matlab pass-by-reference pass-by-value
Is "pass by reference" bad design?

So, I just started learning Java, and I discovered that there's no such thing as "pass by reference". I'm porting …

parameter-passing pass-by-reference
template pass by value or const reference or...?

I can write a templated function this way template<class T> void f(T x) {…} or this way …

c++ templates pass-by-reference pass-by-value
Passing vector of vectors to function

I have a function which accepts a vector<vector<MyClass>> and modifies the MyClass instances. It's …

c++ vector pass-by-reference pass-by-value pass-by-pointer
PHP array_push error

My code is as below, $products = array(); for($i=0; $i < sizeof($sales); $i++){ if(!in_array($sales[$i]['Product'][…

php pass-by-reference array-push
What exactly is copy-on-modify semantics in R, and where is the canonical source?

Every once in a while I come across the notion that R has copy-on-modify semantics, for example in Hadley's devtools …

r pass-by-reference pass-by-value