The ref keyword causes an argument to be passed by reference, not by value. The effect of passing by reference is that any change to the parameter in the method is reflected in the underlying argument variable in the calling method. The value of a reference parameter is always the same as the value of the underlying argument variable.
Questions tagged [ref]
1394 questions
0
votes
1 answer
Calling function with ref parameter
I have a problem with function using ref parameter. This function call herself using linq like this :
public Champ(tabloidConfigColonne tcc,ref Dictionary jointures)
{
...
sousChamps =…

JD11
- 306
- 3
- 11
0
votes
1 answer
Using a ref to pass GridView columns to a method
So I'm working on this VB to C# web application migration and came across an issue that I'm hoping there is an easy work around for. There's a webform that uses the GridView control. In code, it passes the columns collection into a method that adds…

Jason N. Gaylord
- 7,910
- 15
- 56
- 95
0
votes
0 answers
SQL REF Oracle Error
Using some types which i will show below:
CREATE TYPE Course_objtype AS OBJECT (
Course_code VARCHAR2(4),
Course_name VARCHAR2(200),
Study_mode CHAR(2),
Campus REF Campus_list,
Faculty REF Faculty_list,
Director REF Staff_list
);
CREATE TYPE…
0
votes
1 answer
XSD - how to add two 'ref' to the same element
I have been trying to form this XSD, can someone help please...
I have an element 'country' as below:
…

ash
- 31
- 3
0
votes
3 answers
Java reflection to change parameter?
I'm writing a method in Java that I want to simulate references.. Since java doesn't have the out keyword like in C# and doesn't have References/Pointers like in C++, I want to know if I can use reflection to simulate it.
An example would be:
public…

Brandon
- 22,723
- 11
- 93
- 186
0
votes
5 answers
How to pass in the "modifier" string returned by the function?
class test
{
public String get() {return s;}
private String s="World";
}
class modifier
{
public static void modify(ref String v)
{
v+="_test";
}
}
String s1="Earth";
modifier.modify(ref s1); <-------- OK
test c=new…

Mixer
- 1,292
- 3
- 22
- 41
0
votes
2 answers
Using reference (ref) as parameter for objects of the same base class (C#)
Is it possible to pass in an object reference to a method signature for classes that share the same base class? i.e., simplified:
public class ClassA : System.Web.UI.Control
public class ClassB : System.Web.UI.Control
In Page:
private void…

Michael
- 1,786
- 5
- 23
- 42
0
votes
2 answers
Marshalling a structure in an out returns garbage
I am trying to store and retrieve some data into/from an unmanaged dll. I have tried to narrow down my problem by simplifying the struct as much as possible and here is what I am getting down to:
Structure…

pasx
- 2,718
- 1
- 34
- 26
0
votes
2 answers
Creating property to a ref bean, Spring
I have searched in this site a lot of spring.. but i'm really new to this..
so here is my question:
I have 3 main classes i'm gonna put it like this..
public class User
{
private String name;
private ArrayList cars;
public…

Gabriel Figox Vargas Fierro
- 31
- 1
- 2
- 10
0
votes
1 answer
Saving reference in a Field
I'm trying out the following code:
public partial class Test: Window
{
public Test(ref List* Type */> LList)
{
[...]
this.ListField = LList;
}
private List* Type */> ListField;
}
C# doesn't save a reference in…

HerpDerpington
- 3,751
- 4
- 27
- 43
0
votes
1 answer
ref() in Boost::Lambda?
What is the equivalent of Boost::Phoenix's ref in Boost::Lambda? I can't find it in the online docs.
#include
#include
#include
using namespace boost::lambda;
int main()
{
std::string a, b;
…

user541686
- 205,094
- 128
- 528
- 886
0
votes
1 answer
Trouble referencing an array marshaled as unmanaged with a constant size
I am trying to understand what is going on behind the curtain when I create an array with a constant size as below:
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
public float[] constArray;
I understand that I can use the fixed key word, but…

blakejwc
- 55
- 1
- 8
0
votes
1 answer
Where can I see fb_ref data?
I have an external page with like button which likes my Facebook page.
The like button is an app with app_id and so on.
The button is called via

Aramaki
- 51
- 1
- 1
- 6
0
votes
1 answer
ExtJs ref property
I have a code as below,
window = Ext.extend(Ext.Window, {
initComponent: function(){
Ext.applyIf(this,{
fbar: {
xtype: 'toolbar',
items: [{
xtype: 'button',
id: 'button1',
text: 'button1'
…

AJJ
- 3,570
- 7
- 43
- 76
0
votes
1 answer
Peek method return ref object
Alright, so I have a Queue that I use for my print method. It stores the text and the selected font for each line that I need to be printed. The following loop is supposed to print out the contents of the Queue, but it looks like peek returns the…

Grungondola
- 680
- 6
- 26