#include"iostream"
using namespace std;
class A{
private:
static double d;//声明
static long l;
public:
static void show(){
cout << d << " " << l << endl;
}
};
double A::d = 10;//定义并初始化
long A::l = 20;
int main()
{
A a;
a.show();
}
静态成员的声明与实现
最新推荐文章于 2021-03-28 01:57:08 发布