What is a conversion constructor?

Answer Posted / munendra kumar

A constructor that accepts one argument of a different type.

The compiler uses this idiom as one way to infer conversion rules for your class. A constructor with more than one argument and with default argument values can be interpreted by the compiler as a conversion constructor when the compiler is looking for an object of your constructor's type and sees an object of the type of the constructor's first argument.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to demonstrate the use of a variable?

841


Explain some examples of operator overloading?

862


How can I disable the "echo" feature?

821


What is c++ try block?

799


How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?

2053


Is main a class in c++?

748


What are the general quetions are in DEna bank manager IT/System interviews?

1769


What is auto type c++?

841


Why do we need function?

780


How can we access protected and private members of a class?

825


How can you quickly find the number of elements stored in a static array?

838


What is a class definition?

802


What is a lambda function c++?

775


What size is allocated to the union variable?

792


What is the difference between cin.read() and cin.getline()?

802