P

Priyanka Tomar • 35.28K Points
Coach

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
  • Correct Answer - Option(A)
  • Views: 73
  • Filed under category C++

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics