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

Is std :: string immutable?

0 Answers  


What is a built-in function?

1 Answers  


diff between pointer and reference in c++?

1 Answers  


Why do we need templates?

0 Answers  


What are the popular tools used to detect memory leaks in c++

4 Answers   TATA,


What is dangling pointers?and what is memory leak?

5 Answers  


Can non graphic characters be used and processed in C++?

0 Answers   HCL,


Is java made in c++?

0 Answers  


what is the order of initialization for data?

10 Answers   Amazon, TCS, Wipro,


Please explain the reference variable in c++?

0 Answers  


What is the use of data hiding?

0 Answers  


What is the difference between a type-specific template friend class and a general template friend class?

0 Answers  


Categories