请问这段代码里我定义的ref有意义吗?也就是说我把委托变量也定义成ref 这样做有意义吗?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 委托
{
delegate int Pro(int a);
class Program
{
static int Su(int b)
{ return b; }
static void Mu(ref Pro liweike)
{
int dd = 101;
Console.WriteLine(liweike(dd));
Console.WriteLine("成功");
}
static void Main(string[] args)
{
Pro liwei;
liwei = Su;
Mu(ref liwei);
}
}
}
------解决思路----------------------
当前这个是没有意义,详细用法可以查阅
http://baike.baidu.com/link?url=GA1vhnAyZ6WdeirABZ4r3QTUkEcXwpIN0RzJJIGO5nyemTe4YZk7fwoc1GN2MdyhOa4xs3JlHBNMfqIrMlZf1K