Question: Why constructors are efficient instead of a function init() defined by the user to initialize the data members of an object?

Options

A : Because user may forget to call init() using that object leading segmentation fault

B : Because user may call init() more than once which leads to overwriting values

C : Because user may forget to define init() function

D : All of the mentioned

Click to view Correct Answer

Previous || Next

Cplusplus Programming Constructors Destructors 1 more questions

Why are the fundamental ecosystems services largely taken for granted?

Why operating heads of soot blowers are automated?

Why hydrofluorocarbons are no harm to the ozone layer?

Why are bryophyte called plant amphibians?

Why severe fluctuations in power are always undesirable in windmill?

It is advised not to run dc series motor with....

What happens to the inductance when the current in the....

What happens to raw bricks if an excess of alumina....

How does the texture of coal changes with its maturity?

For critically damped second order system, if the gain constant(K)....

Chemical Engineering Basics - Part 1 more Online Exam Quiz

Cplusplus Programming Class Relationships

Cplusplus Programming Class Templates

Cplusplus Programming Command Line Arguments

Cplusplus Programming Complex Library 1

Cplusplus Programming Complex Library 2

Cplusplus Programming Constructors Destructors 2

Cplusplus Programming Cplusplus Concepts 1

Cplusplus Programming Cplusplus Concepts 2

Cplusplus Programming Cplusplus Vs C

C Plus Plus Programming Derived Classes