摘要
this在C++中称为this指针,它代表了当前实例的内存地址;在C#中称为this引用:使用this可以在类中方便地访问到本类的当前实例,也可以将本类的当前实例方便地传送到另一个类中去。通过多个例子,说明了在C++和C#中显示或隐含使用this的方法.这些方法是编辑中的常用技巧.
This, which is called this pointer in C++ and this reference in C# , Standing for memory address of the current instance. We can easily use this to access the current class" active instance in class, also we can easily pass the current class" active instance to other class. In this article, through several examples, Illustrating this usages in C++/C#, These methods are the normal skills ill programming.
作者
李蓓蓓
言海燕
LI Bei-bei,YAN Hai-yan (Hunan Railway Professional Technology College hunan zhuzhou 412001)
出处
《电脑知识与技术》
2007年第2期1052-1054,共3页
Computer Knowledge and Technology