110,572
社区成员
发帖
与我相关
我的任务
分享
int a, b;
a = new int();
b = a;
b = 1;
int *a, *b;
a = new int();
b = a;
*b = 1;
void CopyDict(IDictionary source, ref IDictionary dest)
{
foreach (KeyValuePair pair in source)
{
dest.Add(pair.Key, pair.Value);
}
}
通过传递引用来实现吧
public void PassRefInt(ref int i1, ref int i2)
{
i1 = i2;
}
int a = 12;
int b = 34;
PassRefInt(ref a, ref b);
Response.Write(a);
//34
int *a, *b;
a = new int();
b = a;
*b = 1;