1

Predict the output? #include using namespace std; class Test { int x; Test() { x = 5; } }; int main() { Test *t = new Test; cout << t->x; }

Correct Answer: Compiler Error

Make the most of this question

This page focuses on one C++ MCQs question from Programming. After checking the answer, return to the topic list to practice more or run a timed set.

C++ MCQs MCQ: Predict the output? #include using namespace std; class Test { int x; Test() { x = 5; } }; int main() { Test *t = new Test; cout x; } | Extra Education