陈艾琳宣布离婚:#include<stdio.h>
来源:百度文库 编辑:中科新闻网 时间:2024/06/05 11:18:53
#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;
}
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;
}