Conversion operator, C/C++ Programming

Assignment Help:

What is conversion operator? Explain it with example.


Related Discussions:- Conversion operator

Explain automatic variables, Automatic Variables Automatic variables ar...

Automatic Variables Automatic variables are variable which are explained within the functions. They lose their value when the function terminates. It can be accessed only in th

Queue, write a queue program in c langauge?

write a queue program in c langauge?

Virtual constructor, Is it possible to have Virtual Constructor? If yes, ho...

Is it possible to have Virtual Constructor? If yes, how? If not, Why not possible?

The car’s measurements are illustrated, The car’s measurements are illustra...

The car’s measurements are illustrated, using two arrays. Array 1 = {L, R, L, R, R, L, R, R, L, R, R, L, R, L, L, R, Z}

Flowchart, create a flowchart that display the assume that there are 3 sect...

create a flowchart that display the assume that there are 3 section each student ?

All topics in c, Give practice in writing program''s..

Give practice in writing program''s..

How to write a function template, How to write a function template A fu...

How to write a function template A function template should be written at the beginning of the program in the global area, or you may place it into a header file. All function

Explain the function of five elements that are on a, explain the function o...

explain the function of five elements that are found on a motherboard#

Arrays, how do I randomised numbers in an array?

how do I randomised numbers in an array?

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