M

Mr. Dubey • 100.69K 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) compile time error
  • (B) garbage
  • (C) 0
  • (D) 5
Share

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