There is a class:
class A { public: static int count; A() { count++; // При создании каждого объекта эта переменная должна увеличиваться } }; It is necessary to assign the value of this variable to 0, before calling the constructor. But if you do it like this:
static int count = 0; That compiler swears. How to manage in this situation?