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 |
Can I learn c++ without c?
How to stop conversions among objects?
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.
What is & in c++ function?
What are c++ stream classes?
How do c++ struct differs from the c++ class?
How can you tell what shell you are running on unix system?
Explain this pointer?
Difference between Overloading and Overriding?
35 Answers Appnetix Techno, GameLoft, HP, IBM, NIIT, Rohde and Schwarz,
What is an undefined behavior and sequence points
Where do I find the current c or c++ standard documents?