180. Static Memory

Question.2

A Driver class tracks how many instances exist:

class Driver {
public:
   static int count;
   Driver()  { count++; }
   ~Driver() { count--; }
};
int Driver::count = 0;  // Definition

Driver a, b, c;
printf("%d", Driver::count);

What is printed?

Need Help? Refer to the Quick Guide below

Select Answer