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
Correct Answer:
Verified
Q12: Predict the output of following C++ program#include<iostream>
Q13: class Test { int x;};int main(){Test t;
Q14: Which of the following is true?
A)all objects
Q15: Which of the following is true about
Q16: Which of the following is true about
Q18: What happens when delete is used for
Q19: Is it fine to call delete twice
Q20: Which of the followings is/are automatically added
Q21: Output of following program?#include<iostream> using namespace std;
Q22: #include<iostream> using namespace std; class Point {public:Point()
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents