C
cty0000
I need to set several variable (can be different type) by sub
function..
I don't know the count of variable and type, so i used object type and
parameter list like below source..
After setData function call a1,a2 is still -1 and "AAA"
I want to be change as 3,"BBB"
Does anybody can help me???
class Program
{
static void Main(string[] args)
{
int a1 = -1;
string a2 = "AAA";
setData(a1,a2);
}
public void setData(params object[] list)
{
list[0] = 3;
list[1] = "BBB;
}
}
function..
I don't know the count of variable and type, so i used object type and
parameter list like below source..
After setData function call a1,a2 is still -1 and "AAA"
I want to be change as 3,"BBB"
Does anybody can help me???
class Program
{
static void Main(string[] args)
{
int a1 = -1;
string a2 = "AAA";
setData(a1,a2);
}
public void setData(params object[] list)
{
list[0] = 3;
list[1] = "BBB;
}
}