Conversion operator, C/C++ Programming

Assignment Help:

What is conversion operator? Explain it with example.


Related Discussions:- Conversion operator

Can you overload a function depend only on whether parameter, Can you overl...

Can you overload a function depend only on whether a parameter is a value or a reference? A: No. Passing by value and reference looks identical to the caller.

Define the processing of a structure, Define the Processing of a Structure?...

Define the Processing of a Structure? The members of structure are typically processed individually as separate entities. So we must be able to access the individual structure

What is b-tree, B-tree: A B-tree is an also called balanced m-way tree. A ...

B-tree: A B-tree is an also called balanced m-way tree. A node of the tree may have many records or key and pointers to children. It is also called as the balanced sort tree. It s

Encryption/Decryption, I need to include files so you can understand easier...

I need to include files so you can understand easier.

Class, array of class objects and single inheritance

array of class objects and single inheritance

Develop a windows application to show computer hardware, - But with less fe...

- But with less features and more user-friendly (particularly for non-tech savvy users). - Software needed having a left menu with links (no pictures required) for every hardwar

Flowcharting, how to create a flowchart? can you help me in my assignment a...

how to create a flowchart? can you help me in my assignment about flowcharting ....

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