Conversion operator, C/C++ Programming

Assignment Help:

What is conversion operator? Explain it with example.


Related Discussions:- Conversion operator

Area Under Curve, Write a program to find the area under the curve y = f(x)...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Find area, #question.to determine the area of a triangle,rectangle and tra...

#question.to determine the area of a triangle,rectangle and trapezium

Super ascii, program to convert string from super ascii string with minimum...

program to convert string from super ascii string with minimum cost

Modified distribution method for solving transportation prob, i want a c or...

i want a c or c++ code for solving transportation problem using modified distribution method

For loop, write a c++ program for the sum of 10 numbers and print out the a...

write a c++ program for the sum of 10 numbers and print out the average

Array, Assigning value to individual elements in array

Assigning value to individual elements in array

#title, Given an integer n and a permutation of numbers 1, 2 ... , n-1, n w...

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given

Described the difference among "new" and "operator new" ?, Described the di...

Described the difference among "new" and "operator new" ? A:"operator new" works such as malloc.

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