What is a conversion constructor?



What is a conversion constructor?..

Answer / 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

More C++ General Interview Questions

Write about the use of the virtual destructor?

0 Answers  


Give 10 points of differences between C & C++.

0 Answers   HCL,


Which operator cannot be overloaded c++?

0 Answers  


What is singleton pattern in c++?

0 Answers  


Can member data be public?

0 Answers  






Explain what is polymorphism in c++?

0 Answers  


What are virtual functions in c++?

0 Answers  


What can I safely assume about the initial values of variables which are not explicitly initialized?

0 Answers  


What is the Standard Template Library?

1 Answers  


What is virtual destructor? What is its use?

0 Answers  


What causes a runtime error c++?

0 Answers  


Differentiate between the message and method in c++?

0 Answers  


Categories