Conversion operator, C/C++ Programming

Assignment Help:

What is conversion operator? Explain it with example.


Related Discussions:- Conversion operator

Decode the code, Smugglers are becoming very smart day by day. Now they hav...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Padovan stringf, A Padovan string P(n) for a natural number n is defined as...

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation.

C programs, accept principal amount,rate of interest, & duration from the u...

accept principal amount,rate of interest, & duration from the user. display interest amount and total amount

# Bank Account class, Write a C++ program to test the Bank Account class fo...

Write a C++ program to test the Bank Account class for 10 customers.

Quick Homework, Write three functions in C or C++: one that declares a larg...

Write three functions in C or C++: one that declares a large array statically, one that declares the same large array on the stack, and one that creates the same large array from t

Calculation, write a program to calculate the cuboid

write a program to calculate the cuboid

Padovan string, write a C program for padovan string for a natural number

write a C program for padovan string for a natural number

Pragma, How to specify different memory sections for a variable using #Prag...

How to specify different memory sections for a variable using #Pragma?

Restart, how to create program in c that will system restart

how to create program in c that will system restart

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