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

show that among any group of five (not necessary consecutive ) integers, there are two with the same remainder when divided by 4.

1 Answers  


What is the difference between map and hashmap in c++?

0 Answers  


I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.

0 Answers  


Is it possible to write a c++ template to check for a function's existence?

0 Answers  


why and when we can declar member fuction as a private in the class?

0 Answers  






What is prototype in c++ with example?

0 Answers  


Definition of class?

12 Answers  


simple c++ program for "abcde123ba" convert "ab321edcba" with out using string

5 Answers  


whats the size of class EXP on 32 bit processor? class EXP { char c1; char c2; int i1; int i2; char *ptr; static int mem; };

5 Answers   Huawei,


How can an improvement in the quality of software be done by try/catch/throw?

0 Answers  


What is array in c++ example?

0 Answers  


class professor {}; class teacher : public virtual professor {}; class researcher : public virtual professor {}; class myprofessor : public teacher, public researcher {}; Referring to the sample code above, if an object of class "myprofessor" were created, how many instances of professor will it contain? a) 0 b) 1 c) 2 d) 3 e) 4

4 Answers   Quark,


Categories