language: C++ 4.7.2 (gcc-4.7.2)
date: 209 days 22 hours ago
link:
visibility: private
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>
 
namespace One {
namespace Two {
 
class ExampleClass {
public:
 
    // static members can be accessed without a class being instantiated
        static int i;
};
 
}
}
 
// they also need to be defined outside the class
int One::Two::ExampleClass::i = 500;
 
int main()
{
        std::cout << One::Two::ExampleClass::i << std::endl;
}