private void Page_Load(object sender, System.EventArgs e)
{
string[] aa;
string[] bb;
testes(out aa,out bb);
Response.Write(aa[0]);
}
public void testes(out string[] aa,out string[] bb)
{
aa[0]="cc";
bb[0]="dd";
}
本人想通过testes方法改变两个数组的值。(从没用过out和ref,第一次用)。可是编译时通不过。各位兄弟帮忙看下。先谢了!(能给兄弟讲下out和ref就更加感激不尽了)
{
string[] aa;
string[] bb;
testes(out aa,out bb);
Response.Write(aa[0]);
}
public void testes(out string[] aa,out string[] bb)
{
aa[0]="cc";
bb[0]="dd";
}
本人想通过testes方法改变两个数组的值。(从没用过out和ref,第一次用)。可是编译时通不过。各位兄弟帮忙看下。先谢了!(能给兄弟讲下out和ref就更加感激不尽了)
{
string [] aa;
string [] bb;
testes(out aa,out bb);
Response.Write(aa[0]);
} public void testes(out string[] aa,out string[] bb)
{
aa = new string[]{"cc","dd"};
bb = new string[]{"ee","ff"};
}
bb = new string[]{"ee","ff"};
能说下为什么要这样么?