Overloading method in derived class
Lagarde Sébastien <[email protected]>
| Newsgroups | gmane.games.devel.general |
|---|---|
| Message-ID | <016101c3eb4a$cb169d30$6a01a8c0@NEKODOM> |
Hello all,
I know this is a C++ specific question but i don't know how
to search the answer in google.
I have the following code :
struct Toto { void Add(int x){} };
struct Titi : public Toto { void Add(int x, int y){} };
int main ()
{
Titi titi;
titi.Add(1);
}
And both MSVC 7 and gcc give me
error : 'Titi::Add' : function does not take 1 parameters
sure i could write titi.Toto::Add(1); and this will work but
i want to avoid such a pain.
is it a C++ specification problem or a compiler problem ?
Thanks
------------------------
Lagarde Sébastien
Neko entertainment