R
RA
Hi
What is c# default parameter passing for a method ? Is it ref?
Is this valid to change the object info in a method?
Class1
{
public string name;
int temp;
}
class test:
{
Main ()
{
class1 cs = new class1();
Update (cs);
//I should have here the following
//cs.name = "new name";
//cs.temp = 5;
}
void Update (Class1 cs)
{
cs.name = "new name";
cs.temp = 5;
}
}
Thanks,
Ronen
What is c# default parameter passing for a method ? Is it ref?
Is this valid to change the object info in a method?
Class1
{
public string name;
int temp;
}
class test:
{
Main ()
{
class1 cs = new class1();
Update (cs);
//I should have here the following
//cs.name = "new name";
//cs.temp = 5;
}
void Update (Class1 cs)
{
cs.name = "new name";
cs.temp = 5;
}
}
Thanks,
Ronen