Kindly Remove its errors and tell me the reason for the error.

Code:
https://www.box.com/s/enl4h6loqcnc7jqqgujq

Recommended Answers

All 6 Replies

Please rephrase the question.

Make sure you include the following things:

1) What you're trying to do.
2) What the error is (which means tell us what your compiler error is; the exact words, all of them).
3) The code. Do NOT put your code on another site in a big heap and expect us to read it and magically guess what you're trying to do and what the problem is. This site has formatting options for you to post your code clearly. Do NOT post ALL the code. Post the code relevant to the error. If we need to see more code, we will ask.

Why would anyone want to help you if you ask/request it like that...Post your code that you're struggling with or show where you get errors in your code.

I've posted my code.
Errors:

--------------------Configuration: r - Win32 Debug--------------------
Compiling...
r.cpp
D:\VC 6.0\r\r.cpp(225) : error C2250: 'link' : ambiguous inheritance of 'masterCard::calculate'
        D:\VC 6.0\r\r.cpp(143) : see declaration of 'masterCard'
D:\VC 6.0\r\r.cpp(225) : error C2250: 'link' : ambiguous inheritance of 'visaCard::calculate'
        D:\VC 6.0\r\r.cpp(153) : see declaration of 'visaCard'
D:\VC 6.0\r\r.cpp(225) : error C2250: 'link' : ambiguous inheritance of 'localCard::calculate'
        D:\VC 6.0\r\r.cpp(176) : see declaration of 'localCard'
D:\VC 6.0\r\r.cpp(311) : error C2250: 'll' : ambiguous inheritance of 'masterCard::calculate'
        D:\VC 6.0\r\r.cpp(143) : see declaration of 'masterCard'
D:\VC 6.0\r\r.cpp(311) : error C2250: 'll' : ambiguous inheritance of 'visaCard::calculate'
        D:\VC 6.0\r\r.cpp(153) : see declaration of 'visaCard'
D:\VC 6.0\r\r.cpp(311) : error C2250: 'll' : ambiguous inheritance of 'localCard::calculate'
        D:\VC 6.0\r\r.cpp(176) : see declaration of 'localCard'
Error executing cl.exe.

r.obj - 6 error(s), 0 warning(s)

I've posted my code.

You've posted a link to a picture of your code, and also a link that would enable us to download your code. All of it. That's extremely unhelpful. If you want people to help you, make it easier for them, not harder.

Your code is plain text. These posts are plain text with markup options. Do you get what I'm saying?

The problem here is that you are inheriting from more than one class, and those classes contain identically named functions.

Link inherits from mastercard. mastercard contains the function calculate.
Link inherits from visacard. visacard contains the function calculate.
Link inherits from localcard. localcard contains the function calculate.

So which calculate function is Link meant to inherit?

I want to inherit all calculate functions, and want to use the appropriate one when required by calling matercard::calculate() etc.

I'm sorry about that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.