Answer Posted / swarna sekhar dhar
A constructor that can be called with a single argument is
used for conversions from the type of the argument to the
class type. Such a constructor is called a conversion
constructor. Consider the following example:
/ spec1_conversion_constructors.cpp
class Point
{
public:
Point();
Point( int );
//...
};
int main()
{
}
Sometimes a conversion is required but no conversion
constructor exists in the class. These conversions cannot be
performed by constructors. The compiler does not look for
intermediate types through which to perform the conversion.
For example, suppose a conversion exists from type Point to
type Rect and a conversion exists from type int to type
Point. The compiler does not supply a conversion from type
int to type Rect by constructing an intermediate object of
type Point.
| Is This Answer Correct ? | 16 Yes | 1 No |
Post New Answer View All Answers
Why is polymorphism useful?
What can c++ be used for?
Why is c++ called oops?
What is set in c++?
Explain what are mutator methods in c++?
what are the events occur in intr activated on interrupt vector table
How the programmer of a class should decide whether to declare member function or a friend function?
What jobs can you get with a c++ certification?
What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0
What sorting algorithm does c++ use?
What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h
Does c++ support exception handling?
int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}
write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)
What is isdigit c++?