I was just wondering, are member variables of a class passed by reference if that variable is a value variable?
In other words, if I have a class as such:
class Some
{
public int i;
public Some(){this.i=0;}
}
and I wanted to pass it to a function by reference, would I have to do this:
void foo(int a){a = 2;}
Some s = new Some();
foo(s.i);
or this:
void foo(ref int a){a =2;}
Some s = new Some();
foo(ref s.i);
?
EDIT: I don't know if it matters, but this is in C#.
hippopotomonstrosesquippedaliophobia- the fear of big words