uright

导航

 
C#中的委托,类似于C++中的函数指针
public class testDelegate
    
{
        
public delegate int Max(int a,int b);
        
        
public static void Main()
        
{
            Max _max 
= new Max(System.Math.Max);
            Console.WriteLine(_max(
2,4).ToString());
        }

    }
posted on 2005-03-22 08:19  uright  阅读(312)  评论(0)    收藏  举报