Define conversion operator?, C/C++ Programming

Define conversion operator??

Posted Date: 3/15/2013 5:14:19 AM | Location : United States





Define conversion operator??

A: class can have a public method for specific data type conversions. For instance:

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. conversion operator now gets called to assign the value.

 

 

Posted by | Posted Date: 3/15/2013 5:14:59 AM


Related Discussions:- Define conversion operator?, Assignment Help, Ask Question on Define conversion operator?, Get Answer, Expert's Help, Define conversion operator? Discussions

Write discussion on Define conversion operator?
Your posts are moderated
Related Questions
what are objects or simply define objects

#questi An array of n numbers is given, where n is an even number. The maximum as well as minimum of these given numbers need to be determined. Which of the following is true about

Literals (Constants) Constants are data storage locations whose address is not accessible for the user. Their value is not altered during the course of the program. Literal


2 flowcharts, pseudocode for each (at least 4 algorithms), and code for either a stack or a queuestion..

Simple program of c++: int main() {    int   bushels;    float dollars, rate;                 cout                 cin >> dollars;                 cout

Purpose For this assignment you will need to create either a function list or a record series for a CRCRS. Instructions Note: Complete only one of the two assignment op

Why PHP is sometimes called as embedded scripting language? PHP is a high level language that is used to allow users to write and understand it in human readable form and also

Luminous Jewels - The Polishing Game Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various lum

Just need the answers to the following 3 questions. "NO NEED to write a program compile or run it, do not need it. Just need the answers for the following questions. Example quest