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 CPP Programming question from Engineering. After checking the answer, return to the topic list to practice more or run a timed set.

CPP Programming 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