tagged [pass-by-reference]

Question on Call-By-Reference?

Question on Call-By-Reference? main() calls Call_By_Test() function with argument parameter First Node. I have freed the First Node in Call_By_Test() but First node address not freed in main(), why ?....

C# Pass a property by reference

C# Pass a property by reference Is there anyway to pass the property of an Object by reference? I know I can pass the whole object but I want to specify a property of the object to set and check it's ...

Is Ruby pass by reference or by value?

Is Ruby pass by reference or by value? ``` @user.update_languages(params[:language][:language1], params[:language][:language2], params[:language][:language3]) lang_errors = @us...

List passed by ref - help me explain this behaviour

List passed by ref - help me explain this behaviour Take a look at the following program: ``` class Test { List myList = new List(); public void TestMethod() { myList.Add(100); myList.Ad...

3 Sep at 05:28

How does the C# garbage collector find objects whose only reference is an interior pointer?

How does the C# garbage collector find objects whose only reference is an interior pointer? In C#, `ref` and `out` params are, as far as I know, passed by passing only the raw address of the relevant ...

How to do the equivalent of pass by reference for primitives in Java

How to do the equivalent of pass by reference for primitives in Java This Java code: ``` public class XYZ { public static void main(){ int toyNumber = 5; XYZ temp = new XYZ(); temp.p...

23 May at 11:54

C# pass by value vs. pass by reference

C# pass by value vs. pass by reference Consider the following code It is universally acknowledged (in C# at least) that when you pass by reference, the method contains a reference to the object being ...

Passing objects and a list of objects by reference in C#

Passing objects and a list of objects by reference in C# I have a delegate that modifies an object. I pass an object to the delegate from a calling method, however the calling method does not pick up ...

8 Feb at 16:2

C# 4.0 'dynamic' doesn't set ref/out arguments

C# 4.0 'dynamic' doesn't set ref/out arguments I'm experimenting with `DynamicObject`. One of the things I try to do is setting the values of `ref`/`out` arguments, as shown in the code below. However...

8 Sep at 22:0

C# 7 ref return for reference types

C# 7 ref return for reference types I'm going through some code that uses the new features of C# 7 and uses the ref locals & returns feature. It seems pretty straight forward for `value-types` where t...

5 Feb at 07:51

C# parameters by reference and .net garbage collection

C# parameters by reference and .net garbage collection I have been trying to figure out the intricacies of the .NET garbage collection system and I have a question related to C# reference parameters. ...

23 Mar at 14:55