|
 |
On Wed, 14 May 2008 22:52:33 +0200, Darren New <dne### [at] san rr com> wrote:
> Fredrik Eriksson wrote:
>> On Wed, 14 May 2008 18:23:54 +0200, Darren New <dne### [at] san rr com> wrote:
>>>
>>> *** Main2.cpp
>>>
>>> #include <A.h>
>>>
>>> void A::xx(int i) {
>>> cout << "Beta!\n";
>>> }
>> This will fail to compile, because you cannot redefine A::xx.
>
> I didn't. I created an overloaded version. One takes an int, the other
> takes a long. Am I *completely* clueless about C++?
You cannot add overloads to class methods from outside the class. All
overloads must be declared in the class declaration.
--
FE
Post a reply to this message
|
 |