Q.

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

A. compile time error
B. garbage
C. 0
D. 5
Answer» A. compile time error
1.6k
0
Do you find this helpful?
15

Discussion

No comments yet

Related MCQs