Conversion operator, C/C++ Programming

Assignment Help:

What is conversion operator? Explain it with example.


Related Discussions:- Conversion operator

Destruction of local object, Need assignment help What's the order that ...

Need assignment help What's the order that local objects are destructed?

Algorithms, Ask question #Minimum 100 write an algorithm to calculate simpl...

Ask question #Minimum 100 write an algorithm to calculate simple interest and compound interestwords accepted#

Described the order that objects in an array is destructed?, Described the ...

Described the order that objects in an array is destructed?

Recursive functions, a program to determine whether a number is an odd or e...

a program to determine whether a number is an odd or even using recursive function

Constant argument, Define  C o ns t a n t a r g u me n t : ...

Define  C o ns t a n t a r g u me n t : T h e a r gu m e n t c a n b e a c on s t a n t a r gu m e n t .    T h e c o

Write a program of constructors and destructors, Write a program of constru...

Write a program of constructors and destructors Make a class drugs having encapsulated data for medicine name, whether solid or liquid, price and purpose of use. From this clas

#minimum shelf, #At a shop of marbles, packs of marbles are prepared. Packe...

#At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with the

Jack

2/13/2013 1:10:23 AM

Try this, it will definitely help you

Class can have a public method for particular data type conversions.

class Boo

{

double value;

public:

Boo(int i )

operator double()

{

return value;

}

};

Boo BooObject;

double i = BooObject; // assigning object to variable i of type double. 

now conversion operator gets called to assign the value.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd