A
Q. Predict the output?
Code:
#include <iostream>
using namespace std;
class Test
{
int x;
Test()
{
x = 5;
} };
int main()
{
Test *t = new Test;
cout << t->x;
}
using namespace std;
class Test
{
int x;
Test()
{
x = 5;
} };
int main()
{
Test *t = new Test;
cout << t->x;
}
- Correct Answer - Option(D)
- Views: 21
- Filed under category C++
- Hashtags:
Discusssion
Login to discuss.