南京医科大二附院体检:#include<stdio.h>

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/11 02:43:58
#include<iostream.h>
class Example
{
public:
static int svar;
static void display() //静态函数
{
cout<<"\nthe static variable is:"<<endl;
}
};

int Example::svar=100;

int main()
{
Example::display(); //访问方式1

Example e;
e.display(); //访问方式2
return 0;
}