摘要
深入分析了C++语言中类静态数据成员的声明和访问方法,指出了程序设计中利用全局变量来实现数据共享的弊端,同时给出了利用类静态数据成员取代全局变量的方法以及在程序设计中使用类静态数据成员时应注意的问题,详细阐述了类静态数据成员在程序设计中的作用,并举了相应的实例来说明如何正确使用静态数据成员。
On the basis of a thorough analysis of the methods of declaration and accessing to the static data member in C + + language, authors point out the abuse of utilizing global variable to implement the shared data in program design, and at the same time give out the ways how a static data member replaces the global variable and questions to be paid attention to in using static data member. In addition, the effect of static data member in programming is described in detail, and finally this paper gives the examples to show how to use correctly static data members.
出处
《陕西理工学院学报(自然科学版)》
2005年第4期22-24,共3页
Journal of Shananxi University of Technology:Natural Science Edition