Click here to Skip to main content
15,851,453 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Look at the Following program
Write proper constructor/conversion operator in appropriate class in editable section to make function convert( ) workable, which cast/convert unrelat to unrelat_1 class type.
#include <iostream>

 using namespace std;

class unrelat{ };
class unrelat_1 { };

int Convert( class unrelat_1 &c, class unrelat &d){
         int i = 5;
         cin >> i ;
         c = d;
         c = static_cast<unrelat_1>(d);
         c = (unrelat_1)d;
         return (i*10+35) ;
     int main() {
         int out;
         unrelat_1 a;
         unrelat b;
         out = Convert(a, b);
         cout << out ;
         return 0;

What I have tried:


Updated 14-Sep-17 10:52am
Dave Kreskowiak 14-Sep-17 13:29pm    
So did you have a question or were you expecting someone to do your work for you?

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
Share this answer
What about 'the documentation'[^]?
Share this answer
You didn't stated any problem, you didn't asked any question, you didn't tried any thing.

No, we do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900