How to stop conversions among objects?

Answers were Sorted based on User's Feedback



How to stop conversions among objects?..

Answer / vk

Using explicit keyword in the constructor

Is This Answer Correct ?    4 Yes 0 No

How to stop conversions among objects?..

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

How to stop conversions among objects?..

Answer / p.madhupriya

declare the duplicate operator.

Is This Answer Correct ?    0 Yes 0 No

How to stop conversions among objects?..

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

How to stop conversions among objects?..

Answer / anupam deo

Use operator overloading

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More C++ General Interview Questions

How do you sort a sort function in c++ to sort in descending order?

0 Answers  


Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;

0 Answers  


How a new element can be added or pushed in a stack?

0 Answers  


When to use Multiple Inheritance?

6 Answers  


What are guid? Why does com need guids?

0 Answers  






Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like. [ I ended up giving about 4 or 5 different solutions for this, each supposedly better than the others ].

1 Answers  


What is null c++?

0 Answers  


Difference between pointer to constant and constant pointer to a constant. Give example.

0 Answers   HAL,


What is meant by iomanip in c++?

0 Answers  


What is a v-table?

0 Answers  


To what does “event-driven” refer?

0 Answers  


Explain shallow copy?

0 Answers  


Categories