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

What is object file? How can you access object file?

0 Answers  


Can we delete this pointer in c++?

0 Answers  


What are vectors used for in c++?

0 Answers  


What are the advantages of c++ over c?

0 Answers  


How do you flush std cout?

0 Answers  


What is the array and initializing arrays in c++?

0 Answers  


Define what is constructor?

0 Answers  


What do you mean by overhead in c++?

0 Answers  


How much maximum can you allocate in a single call to malloc()?

0 Answers  


Is c++ the most powerful language?

0 Answers  


Is it possible for the objects to read and write themselves?

0 Answers  


C++ program output? Explain output of this program. #include <iostream> using std::cout; using std::cin; int main() {   cout<<cout<<' ';   cout<<cin;   return 0; } It prints some address in hexadecimal. what is it?

1 Answers  


Categories