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

Can I learn c++ without c?

0 Answers  


How to stop conversions among objects?

5 Answers   Symphony,


What are advantages of C++ when comparing with C?

18 Answers   HP, iGate, TCS,


A milk carton can hold 3.78 litres of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one litre of milk is $0.38, and the profit of each carton of milk is $0.27. Write a C++ program that prompts the user to enter the total amount of milk produced in the morning. Then display the number of milk cartons needed to hold milk, the cost of producing milk, and the profit for producing milk.

2 Answers  


What is & in c++ function?

0 Answers  






What are c++ stream classes?

0 Answers  


How do c++ struct differs from the c++ class?

0 Answers  


How can you tell what shell you are running on unix system?

0 Answers  


Explain this pointer?

0 Answers  


Difference between Overloading and Overriding?

35 Answers   Appnetix Techno, GameLoft, HP, IBM, NIIT, Rohde and Schwarz,


What is an undefined behavior and sequence points

0 Answers  


Where do I find the current c or c++ standard documents?

0 Answers  


Categories