ExamVeda
Login
Home
41
What is the default access specifier for members of a class in C++?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
42
Which keyword is used to make a class inheritable by other classes in C++?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
43
What is the purpose of destructors in C++?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
44
What will be the output of the following C++ code?
#include<iostream> 
using namespace std; 
class Base { 
public: 
	Base()	 
	{ cout<<"Constructing Base \n"; } 
	virtual~Base() 
	{ cout<<"Destructing Base \n"; }	 
}; 
class Derived: public Base { 
public: 
	Derived()	 
	{ cout<<"Constructing Derived \n"; } 
	~Derived() 
	{ cout<<"Destructing Derived \n"; } 
}; 
 
int main(void) 
{ 
	Derived *d = new Derived(); 
	Base *b = d; 
	delete b; 
	return 0; 
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
45
Which concept allows you to reuse the written code?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
46
What is virtual inheritance?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
47
How structures and classes in C++ differ?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
48
Which of the following class allows to declare only one object of it?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
49
Which of the following is correct about new and malloc?
i. new is an operator whereas malloc is a function
ii. new calls constructor malloc does not
iii. new returns required pointer whereas malloc returns void pointer and needs to be typecast
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
50
How run-time polymorphisms are implemented in C++?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board