700+ câu trắc nghiệm Ngôn ngữ lập trình C có đáp án - Phần 19

What is the output of the following code? #include int count = 0; class obj { public: obj() { count++; } ~obj() { count--; } }; int main() { obj A, B, C, D, E; obj F; { obj G; } std::cout <<

23/25

What is the output of the following code? #include int count = 0; class obj { public: obj() { count++; } ~obj() { count--; } }; int main() { obj A, B, C, D, E; obj F; { obj G; } std::cout << count; return 0; }

0

5

6

7

Giải thích

Chọn đáp án C