这些东西我觉得只能算是c++的细节吧,但是有些还是得了解的。
#include <iostream>
using namespace std;
class staticDemo {
public:
class inner {
static int i;
public:
void print() const {
cout << "i: " << i << endl;
}
};
};
int staticDemo::inner::i = 1000;
int main() {
staticDemo::inner in;
in.print();
}
|
阅读(1136) | 评论(0) | 转发(0) |