Question OOP-CLS-0009
MediumWhat is the output of this code?
#include <iostream>
using namespace std;
class Box {
public:
static int count;
Box() { count++; }
};
int Box::count = 0;
int main() {
Box a, b, c;
cout << Box::count;
return 0;
}
- A.
3
- B.
0
- C.
Sign up free to see the answer and a step-by-step explanation.