Top "Ref" questions

The ref keyword causes an argument to be passed by reference, not by value.

What's the difference between the 'ref' and 'out' keywords?

I'm creating a function where I need to pass an object so that it can be modified by the function. …

c# reference keyword out ref
How to properly reference local resources in HTML?

As it turns out, referencing local resources can be a rub point for some. I'm looking for a canonical answer …

html src ref
Why use the 'ref' keyword when passing an object?

If I am passing an object to a method, why should I use the ref keyword? Isn't this the default …

c# .net pass-by-reference ref
Assigning out/ref parameters in Moq

Is it possible to assign an out/ref parameter using Moq (3.0+)? I've looked at using Callback(), but Action<> …

c# parameters moq ref out
PL/SQL print out ref cursor returned by a stored procedure

How can I fetch from a ref cursor that is returned from a stored procedure (OUT variable) and print the …

oracle plsql cursor ref
When to use ref and when it is not necessary in C#

I have a object that is my in memory state of the program and also have some other worker functions …

c# ref
powershell: how to write-host value from [ref] variable

I'm new to Powershell and I'm trying to work out how to print the value of a [ref] variable from …

function powershell ref
current is always null when using React.createRef

I was trying to do this. I must be missing something, but I don't understand why current is always null …

javascript reactjs ref
C#: How to pass null to a function expecting a ref?

I've got the following function: public static extern uint FILES_GetMemoryMapping( [MarshalAs(UnmanagedType.LPStr)] string pPathFile, out ushort Size, [MarshalAs(…

c# null pinvoke parameters ref
C# ref is it like a pointer in C/C++ or a reference in C++?

I'm working with the ref and don't understand clearly "Is it like a pointer as in C/C++ or it's …

c# pointers memory-management reference ref