#include using namespace std; class A{ public: static int cnt; A() { ++cnt; cout<<\"constructor:\"<
You need to count copy constructor calls as well. In C++11 there are also move constructors that need to be taken into account.