A counter variable is one that can be incremented or decremented:
You need an object that does this.
Consider writing a class with a default constructor that sets the count to zero and on overload of the ++ operator to increment the count:
- Count obj; //count is 0
-
++obj; //count is 1
You may need additional methods to compare the object's count to some value.