πŸ“Š C++
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;
}
  • (A) 0
  • (B) 5
  • (C) Garbage Value
  • (D) Compiler Error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Compiler Error

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
264
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
82%
Success Rate