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

Does improper inheritance have a potential to wreck a project?

624


What are manipulators used for?

603


What is a static member?

610


Why c++ is so important?

602


Why is c++ difficult?

600






Eplain extern keyword?

558


What does scope resolution operator do?

590


What is object in c++ wikipedia?

568


Explain the use of this pointer?

634


Define basic type of variable used for a different condition in C++?

662


Describe linkages and types of linkages?

561


What is ofstream c++?

583


Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

619


What is function overloading c++?

570


Explain public, protected, private in c++?

563