How to stop conversions among objects?
Answers were Sorted based on User's Feedback
Answer / kavitha
If any situation like that the constructor should build the
objects and should not get used for carrying out
conversions, In that situation we are required to use the
explicit keyword with the constructor.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / v.senthil kumaran
Declare operator function (dummy) for assignment operator
in the private section of the class.
| Is This Answer Correct ? | 0 Yes | 2 No |
What size is allocated to the union variable?
What is the latest c++ standard?
What gives the current position of the put pointer?
Are php strings immutable?
Define the process of error-handling in case of constructor failure?
What is pointer to member?
class Foo { public: Foo(int i) { } }; class Bar : virtual Foo { public: Bar() { } }; Bar b; Referring to the above code, when the object 'b' is defined, a compiler error will occur. What action fixes the compiler error? a) Adding a virtual destructor to the class Bar b) Adding a constructor to Bar which takes an int parameter c) Adding "Foo()" to the Bar constructor d) Adding a copy constructor to the class Foo e) Adding "Foo(0)" to the Bar::Bar initializer list
What is c++ 11 and c++ 14?
What is the latest c++ version?
Do you know what is overriding?
Why do we use using namespace std in c++?
List out function which we can call without using object