前言:
方法的传值与传地址一直是困扰很多初学者的问题,下面通过举例来向大家说明一下我的理解。
举个栗子:先看下面的程序:
class Program
{
static void SwapValue(int a, int b)
{
int temp = a;
a = b;
b = temp;
}
static void Main(string[] args)
{
int a = 100;
int b = 10;
Console.WriteLine("执行传值函数前a&