#include <iostream> class A { public: void foo() { std::cout << "hi"; }; }; int _tmain(int argc, _TCHAR* argv[]) { A *a = NULL; (*a).foo(); return 0; }