【 在 DorD 的大作中提到: 】
: 标 题: Re: 静态成员问题
: 发信站: 水木社区 (Sat Oct 5 15:46:42 2024), 站内
:
: #include<iostream>
: using namespace std;
:
: class A
: {
: public:
: static int a;
:
: };
: int a=1;
把上面这行改成
int A::a = 1;
: int main()
: {
:
: cout<<A::a<<endl;
: return 0;
: }
: 写成了这样,无语法错误,但还是编译通不过。
: --
:
: ※ 来源:·水木社区
http://www.mysmth.net·[FROM: 36.143.165.*]
--
FROM 117.143.144.*