![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
.NET基础文章
opbsm
这个作者很懒,什么都没留下…
展开
-
ref和out 转贴
首先,如果不使用这两个关键字,那是什么样 呢?看下面的例子:using System; class Test { static void Swap(ref int x, ref int y) { int temp = x; x = y; y = temp; } static转载 2006-02-13 14:59:00 · 1415 阅读 · 2 评论 -
C#委托、事件、自定义事件的理解
一、委托委托类似于函数指针,但函数指针只能引用静态方法,而委托既能引用静态方法,也能引用实例方法。委托使用分三步:1、委托声明。2、委托实例化。3、委托调用。例程一:using System;namespace 委托{ delegate int NumOpe(int a,int b); //委托声明 class Class1 { static void Main(string[]原创 2006-02-19 23:11:00 · 2437 阅读 · 1 评论