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. Compiler Error
B. 5
C. Garbage Value
D. 0
Answer» A. Compiler Error
2.2k
0
Do you find this helpful?
13

View all MCQs in

CPP Programming

Discussion

No comments yet

Related MCQs