检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
机构地区:[1]江西制造职业技术学院实验中心,江西南昌330001 [2]南昌航空工业学院,江西南昌330063
出 处:《电脑知识与技术》2006年第7期162-163,共2页Computer Knowledge and Technology
摘 要:本文深入分析了C++语言中类静态数据成员和静态成员函数的作用以及声明和访问方法,指出了程序设计中利用全局变量来实现数据共享的弊端,同时给出了解决方案,也指出了静态成员函数访问非静态成员的解决方法,并举了相应的实例来说明如何正确使用静态数据成员和静态成员函数。On the basis of deep analyzing the effect of static data member and static member fimction in C++ language,and discussing the methods of declaration and accessing,and pointing out the abuse of utilizing global variable to implement shared data in program design,and at the same time giving out the resolvent,in addition,indicating the resolvent in which static member function can access non-static member function, and finally the author gives the examples to show how to use correctly static data members and static member function.
关 键 词:类 C++ 静态数据成员 静态成员函数 全局变量
分 类 号:TP312[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:216.73.216.38