Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

Cpp Programming

Cpp Programming Quiz 211 – What will be the output of the following program?

Question: What will be the output of the following program?

#include
class BixBase
{
public:
BixBase()
{
cout<< "Base OK. "; } virtual ~BixBase() { cout<< "Base DEL. "; } }; class BixDerived: public BixBase { public: BixDerived() { cout<< "Derived OK. "; } ~BixDerived() { cout<< "Derived DEL. "; } }; int main() { BixBase *basePtr = new BixDerived(); delete basePtr; return 0; }

[A].Base OK. Derived OK.
[B].Base OK. Derived OK. Base DEL.
[C].Base OK. Derived OK. Derived DEL.
[D].Base OK. Derived OK. Derived DEL. Base DEL.

Answer: Option D

Cpp Programming Quiz 211 – What will be the output of the following program? Read More »

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 212 – What will be the output of the following program?

Question: What will be the output of the following program?

#include
class BixBase
{
public:
BixBase()
{
cout<< "Base OK. "; } ~BixBase() { cout<< "Base DEL. "; } }; class BixDerived: public BixBase { public: BixDerived() { cout<< "Derived OK. "; } ~BixDerived() { cout<< "Derived DEL. "; } }; int main() { BixBase *basePtr = new BixDerived(); delete basePtr; return 0; }

[A].Base OK. Derived OK.
[B].Base OK. Derived OK. Base DEL.
[C].Base OK. Derived OK. Derived DEL.
[D].Base OK. Derived OK. Derived DEL. Base DEL.

Answer: Option B

Cpp Programming Quiz 212 – What will be the output of the following program? Read More »

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 215 – If the copy constructor receives its arguments by value, the copy constructor would

Question: If the copy constructor receives its arguments by value, the copy constructor would
[A].call one-argument constructor of the class
[B].work without any problem
[C].call itself recursively[D].call zero-argument constructor

Answer: Option C

Cpp Programming Quiz 215 – If the copy constructor receives its arguments by value, the copy constructor would Read More »

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 217 – Copy constructor must receive its arguments by __________ .

Question: Copy constructor must receive its arguments by __________ .
[A].
either pass-by-value or pass-by-reference
[B].only pass-by-value
[C].

only pass-by-reference
[D].

only pass by address

Answer: Option C

Explanation:

No answer description available for this question.

Cpp Programming Quiz 217 – Copy constructor must receive its arguments by __________ . Read More »

Constructors And Destructors, Cpp Programming