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

Which algorithm do you like the most? Why?

2 Answers   Google,


Write a program to find the reverse Fibonacci series starting from N.

0 Answers   Huawei,


List the advantages of inheritance.

0 Answers  


Differentiate between structure and class in c++.

0 Answers  


Difference between class and structure.

0 Answers  


Snake Game: This is normal snake game which you can find in most of the mobiles. You can develop it in Java, C/C++, C# or what ever language you know.

0 Answers  


Why do we learn c++?

0 Answers  


Which software is best for coding?

0 Answers  


What is the iunknown interface?

0 Answers  


What is long in c++?

0 Answers  


How to avoid changing constant values?

2 Answers   Symphony,


What is difference between rand () and srand ()?

0 Answers  


Categories