I
iceColdFire
Hi,
What is the Diff btwn Function overloading and overriding
thanks,
a.a.cpp
What is the Diff btwn Function overloading and overriding
thanks,
a.a.cpp
Overloading refers to the selection of multiple signatures of functionsiceColdFire said:Hi,
What is the Diff btwn Function overloading and overriding
iceColdFire said:Hi,
What is the Diff btwn Function overloading and overriding
Jaspreet said:However,
int area(int side);
float area(int length);
are not valid examples of overloading since the signature is the same
and the only difference is in the return type.
Ron said:It's a perfectly valid form of overloading,
it just may be ill-formed or ambiguous depending on the context.
int area(int side);
float area(int length);
are not valid examples of overloading since the signature is the same
and the only difference is in the return type.
And this counters what I said how?Jaspreet said:It's a perfectly valid form of overloading, it just may be ill-formed
or ambiguous depending on the context.
I am using gcc 3.2.2 and it gives me the following error:
Ron said:It's a perfectly valid form of overloading, it just may be ill-formed
or ambiguous depending on the context.
I said it can either be ill-formed or ambiguous DEPENDING ON THEJaspreet said:Hi Ron
You mentioned it is a **perfectly valid form of overloading**. It is
not.
Ron said:And this counters what I said how?
USING].Ron said:I said it can either be ill-formed or ambiguous DEPENDING ON THE
CONTEXT. In your example it's ill-formed. There are other cases
where it's not ill-formed to declare such, but it gets ambiguous
when you try to actually use it. [Put the two area's in different
namespaces and then bring them into the current namespace with
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.