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

What is general format for a prototype?

599


Why do we use the using declaration?

664


What is the use of register keyword with the variables?

549


Which format specifier is used for printing a pointer value?

581


what is Loop function? What are different types of Loops?

645






What is the use of c++ programming language in real life?

567


How do you differentiate between overloading the prefix and postfix increments?

592


Explain the scope of resolution operator.

633


What is the sequence of destruction of local objects?

558


List the types of polymorphism in c++?

627


How do you compile the source code with your compiler?

620


Write a struct time where integer m, h, s are its members?

520


What is diamond problem in c++?

542


Which software is used for c++ programming?

618


What does iomanip mean in c++?

605