Exam 4: C++ Programming and Concepts: Inheritance, Data Types, Objects, and Output Prediction

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor?

(Multiple Choice)
4.9/5
(47)

Predict the output?#include <iostream> using namespace std;class Test{int x;Test() { x = 5;}};int main(){Test *t = new Test; cout <<t->x;}

(Multiple Choice)
4.8/5
(39)

#include<iostream> using namespace std; class Point {public:Point() { cout <<"Constructor called"; }};int main(){Point t1, *t2; return 0;}

(Multiple Choice)
4.8/5
(37)
Showing 21 - 23 of 23
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)