#include #include using namespace std; class myclass { public: static int i; static const int j = 20; static void f() {cout << "myclass::f\n";} }; int myclass::i = 10; const int myclass::j; //needed because we're taking address of j int main() { int *p1 = &myclass::i; const int *p2 = &myclass::j; cout << "myclass::i == " << *p1 << "\n" << "myclass::j == " << *p2 << "\n"; void (*p3)() = myclass::f; //or &myclass::f with explicit "address of" p3(); //or (*p3)() with explicit dereferencing operator return EXIT_SUCCESS; }